Merge pull request #2199 from vsemozhetbyt/patch-6

Clarify some things in 1.5.12
This commit is contained in:
Ilya Kantor 2020-11-25 08:47:10 +03:00 committed by GitHub
commit 50c3e3de80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,7 +105,7 @@ JSON is data-only language-independent specification, so some JavaScript-specifi
Namely:
- Function properties (methods).
- Symbolic properties.
- Symbolic keys and values.
- Properties that store `undefined`.
```js run
@ -276,6 +276,7 @@ name: John
name: Alice
place: [object Object]
number: 23
occupiedBy: [object Object]
*/
```
@ -328,6 +329,8 @@ alert(JSON.stringify(user, null, 2));
*/
```
The third argument can also be a string. In this case, the string is used for indentation instead of a number of spaces.
The `space` parameter is used solely for logging and nice-output purposes.
## Custom "toJSON"