title: Flow
layout: 2017/sheet
category: JavaScript libraries
-updated: 2017-09-20
+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.
```
{: data-line="2"}
-See: [Dynamic object keys](https://flow.org/docs/objects.html#objects-as-maps)
+See: [Dynamic object keys](https://flow.org/en/docs/types/objects/#toc-objects-as-maps)
## Advanced features
type Country = $Keys<typeof countries>
```
-See: [Enums](https://flow.org/docs/utility-types.html#keyst)
+See: [Enums](https://flow.org/en/docs/types/utilities/#toc-keys)
### Type aliases
}
```
-See: [Type aliases](https://flow.org/docs/quick-reference.html#type-aliases)
+See: [Type aliases](https://flow.org/en/docs/types/aliases/)
### Generic classes
var n: GenericClass<number> = new GenericClass(0)
```
-See: [Generic classes](https://flow.org/docs/quick-reference.html#generics)
+See: [Generic classes](https://flow.org/en/docs/types/generics/#toc-classes-with-generics)
### Interfaces
(new Foo: Jsonable)
```
-See: [Interfaces](https://flow.org/docs/quick-reference.html#interfaces)
+See: [Interfaces](https://flow.org/en/docs/types/interfaces/)
### Functions
}
```
-See: [Functions](https://flow.org/docs/functions.html)
+See: [Functions](https://flow.org/en/docs/types/functions/)
### Imports