Merge pull request #3075 from chilipenko/1-02-05-data-types-separation
Add separation between primitives and objects to the summary
This commit is contained in:
commit
fd1278eb8b
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.
|
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>.
|
- Seven primitive data types:
|
||||||
- `bigint` is for integer numbers of arbitrary length.
|
- `number` for numbers of any kind: integer or floating-point, integers are limited by <code>±(2<sup>53</sup>-1)</code>.
|
||||||
- `string` for strings. A string may have zero or more characters, there's no separate single-character type.
|
- `bigint` for integer numbers of arbitrary length.
|
||||||
- `boolean` for `true`/`false`.
|
- `string` for strings. A string may have zero or more characters, there's no separate single-character type.
|
||||||
- `null` for unknown values -- a standalone type that has a single value `null`.
|
- `boolean` for `true`/`false`.
|
||||||
- `undefined` for unassigned values -- a standalone type that has a single value `undefined`.
|
- `null` for unknown values -- a standalone type that has a single value `null`.
|
||||||
- `object` for more complex data structures.
|
- `undefined` for unassigned values -- a standalone type that has a single value `undefined`.
|
||||||
- `symbol` for unique identifiers.
|
- `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.
|
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