Add separation between primitives and objects to the summary
This commit is contained in:
parent
7964b11b8f
commit
81fb2ab549
1 changed files with 10 additions and 8 deletions
|
@ -263,14 +263,16 @@ Some people prefer `typeof(x)`, although the `typeof x` syntax is much more comm
|
|||
|
||||
There are 8 basic data types in JavaScript.
|
||||
|
||||
- `number` for numbers of any kind: integer or floating-point, integers are limited by <code>±(2<sup>53</sup>-1)</code>.
|
||||
- `bigint` is for integer numbers of arbitrary length.
|
||||
- `string` for strings. A string may have zero or more characters, there's no separate single-character type.
|
||||
- `boolean` for `true`/`false`.
|
||||
- `null` for unknown values -- a standalone type that has a single value `null`.
|
||||
- `undefined` for unassigned values -- a standalone type that has a single value `undefined`.
|
||||
- `object` for more complex data structures.
|
||||
- `symbol` for unique identifiers.
|
||||
- Seven primitive data types:
|
||||
- `number` for numbers of any kind: integer or floating-point, integers are limited by <code>±(2<sup>53</sup>-1)</code>.
|
||||
- `bigint` for integer numbers of arbitrary length.
|
||||
- `string` for strings. A string may have zero or more characters, there's no separate single-character type.
|
||||
- `boolean` for `true`/`false`.
|
||||
- `null` for unknown values -- a standalone type that has a single value `null`.
|
||||
- `undefined` for unassigned values -- a standalone type that has a single value `undefined`.
|
||||
- `symbol` for unique identifiers.
|
||||
- And one non-primitive data type:
|
||||
- `object` for more complex data structures.
|
||||
|
||||
The `typeof` operator allows us to see which type is stored in a variable.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue