What is JSON?
You can pass an array to the "replacer" parameter to filter the result JSON for only specific properties:
Converting an object to a custom JSON
You can also convert an object to a custom JSON string using the third parameter of the JSON.stringify(value, replacer, space) method. In this example, we use the "space" parameter to add break characters to the output JSON string: