JavaScript: JSON.stringify

By Xah Lee. Date: . Last updated: .
JSON.stringify(obj)
Convert a JavaScript object to JSON string format.
const x = { a: 3, b: [4, 2] };

console.log(
  JSON.stringify(x) === `{"a":3,"b":[4,2]}`,
);
BUY
ΣJS
JavaScript in Depth

Array to String


JS Obj Reference

JSON