Skip to content

Commit 90e65b4

Browse files
authored
Merge pull request #1252 from pascal-bourut/patch-1
Third argument from JSON.stringify is "space".
2 parents 286eef7 + 2ad0ff1 commit 90e65b4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

1-js/05-data-types/12-json/article.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,13 @@ The first call is special. It is made using a special "wrapper object": `{"": me
286286
The idea is to provide as much power for `replacer` as possible: it has a chance to analyze and replace/skip even the whole object if necessary.
287287

288288

289-
## Formatting: spacer
289+
## Formatting: space
290290

291-
The third argument of `JSON.stringify(value, replacer, spaces)` is the number of spaces to use for pretty formatting.
291+
The third argument of `JSON.stringify(value, replacer, space)` is the number of spaces to use for pretty formatting.
292292

293-
Previously, all stringified objects had no indents and extra spaces. That's fine if we want to send an object over a network. The `spacer` argument is used exclusively for a nice output.
293+
Previously, all stringified objects had no indents and extra spaces. That's fine if we want to send an object over a network. The `space` argument is used exclusively for a nice output.
294294

295-
Here `spacer = 2` tells JavaScript to show nested objects on multiple lines, with indentation of 2 spaces inside an object:
295+
Here `space = 2` tells JavaScript to show nested objects on multiple lines, with indentation of 2 spaces inside an object:
296296

297297
```js run
298298
let user = {
@@ -328,7 +328,7 @@ alert(JSON.stringify(user, null, 2));
328328
*/
329329
```
330330

331-
The `spaces` parameter is used solely for logging and nice-output purposes.
331+
The `space` parameter is used solely for logging and nice-output purposes.
332332

333333
## Custom "toJSON"
334334

0 commit comments

Comments
 (0)