JS: JSON.stringify

By Xah Lee. Date: . Last updated: .


Convert a JavaScript object to JSON string format.

    JSON.stringify ( {a:3 , b:[4,2]})
// prints
// {"a":3,"b":[4,2]}

JSON.stringify takes optional 2nd and 3rd args. For detail, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify

JS String

  1. String Overview
  2. Template String
  3. Char, Code Unit, Codepoint
  4. String Escape Sequence
  5. Unicode Escape Sequence

Like it? Help me by telling your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials