Clarify some things in 1.5.12

This commit is contained in:
Vse Mozhe Buty 2020-10-15 04:44:52 +03:00 committed by GitHub
parent 15767fc3cf
commit 0be77b09a0
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: Namely:
- Function properties (methods). - Function properties (methods).
- Symbolic properties. - Symbolic keys and values.
- Properties that store `undefined`. - Properties that store `undefined`.
```js run ```js run
@ -276,6 +276,7 @@ name: John
name: Alice name: Alice
place: [object Object] place: [object Object]
number: 23 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. The `space` parameter is used solely for logging and nice-output purposes.
## Custom "toJSON" ## Custom "toJSON"