Values & Types
Type hierarchy
JavaScript for impatient programmers (Book)
Literal Types
Category | Types | Values |
---|---|---|
Primitive | Undefined | undefined |
Primitive | Null | null |
Primitive | Boolean | true , false |
Primitive | Number | -15 15 , 0b1111 , 0o17 , 0xf -123.45 123.45 , 1.2345e2 , 12345E-2 |
Primitive | String | 'Hello' , "Hello" , `Hello` |
Primitive | Symbol | Symbol("number") |
Object | Array | [] [1, 2, 3] [1, '2', true, [3, false]] ["Alice", "alice@ifpb.edu.br"] |
Object | Object | {name: "Alice", email: "alice@ifpb.edu"} |
Object | Map | new Map([[0, 1],[2, 3], [1, 3]]) |
Object | Set | new Set([1, 1, 1, 2, 2, 3, 4, 5]) |
Object | Date | new Date() |