title: Flow
layout: 2017/sheet
category: JavaScript libraries
-updated: 2018-11-07
+updated: 2020-07-05
weight: -3
tags: [Featurable]
---
## Objects
{: .-three-column}
-### Extra object fields
+### Width subtyping
```js
type Artist = {
```js
const a: Artist = {
name: 'Miguel Migs',
- label: 'Naked Music'
+ label: 'Naked Music',
+ genre: 'House' // ✓ OK
}
-
-a.genre = 'House' // ✓ OK
```
{: data-line="6"}
-You can add more fields to an object.
+A type with more properties is "wider" and is a subtype of a "narrower" type.
See: [Width subtyping](https://flow.org/en/docs/lang/width-subtyping/)
{: data-line="1,4"}
```js
-const a: Artist = { ··· }
-a.genre = 'House' // ✗ Error
+const a: Artist = {
+ name: 'Miguel Migs',
+ label: 'Naked Music',
+ genre: 'House' // ✗ Error
+}
```
-{: data-line="2"}
+{: data-line="4"}
Exact object types prevent extra properties from being added to an object.