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:
Ilya Kantor 2022-06-23 10:14:12 +03:00 committed by GitHub
commit fd1278eb8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.