From 2ad0ff194b5dc466a6b9e6e0354ba7219ca38d59 Mon Sep 17 00:00:00 2001 From: Pascal BOURUT Date: Tue, 20 Aug 2019 15:21:31 -0700 Subject: [PATCH] Third argument from JSON.stringify is "space". Argument "space" was spelt "spacer" or "spaces" in the article. --- 1-js/05-data-types/12-json/article.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/1-js/05-data-types/12-json/article.md b/1-js/05-data-types/12-json/article.md index 0c2a2949..a701c76b 100644 --- a/1-js/05-data-types/12-json/article.md +++ b/1-js/05-data-types/12-json/article.md @@ -286,13 +286,13 @@ The first call is special. It is made using a special "wrapper object": `{"": me 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. -## Formatting: spacer +## Formatting: space -The third argument of `JSON.stringify(value, replacer, spaces)` is the number of spaces to use for pretty formatting. +The third argument of `JSON.stringify(value, replacer, space)` is the number of spaces to use for pretty formatting. -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. +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. -Here `spacer = 2` tells JavaScript to show nested objects on multiple lines, with indentation of 2 spaces inside an object: +Here `space = 2` tells JavaScript to show nested objects on multiple lines, with indentation of 2 spaces inside an object: ```js run let user = { @@ -328,7 +328,7 @@ alert(JSON.stringify(user, null, 2)); */ ``` -The `spaces` parameter is used solely for logging and nice-output purposes. +The `space` parameter is used solely for logging and nice-output purposes. ## Custom "toJSON"