JSON.stringify

stringify — Converts the input to a json parsable format.

Description

JSON.stringify(mixed json)

Parameters

Name Description Type Default Optional
json mixed No

Examples

Example #1 – stringify example
console.log(JSON.stringify(1.5)); // 1.5 console.log(JSON.stringify({"Hello": "World"})); // {"Hello":"World"} console.log(JSON.stringify('String')); // "String"

External references