JS: JSON.parse

By Xah Lee. Date: . Last updated: .


Convert JSON string to a JavaScript value.

const jsonString = '{"a":3 , "b":[4,2]}';


// { a: 3, b: [ 4, 2 ] }

JSON.parse takes optional 2nd arg. For detail, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse

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