2

Is it possible convert string from JSON.stringify back to Array?

sein
  • 149
  • 1
  • 2
  • 11

1 Answers1

21

JSON.parse is your friend and answer :)

//examples:
JSON.parse('{}'); // {}
JSON.parse('true'); // true
JSON.parse('"foo"'); // "foo"
JSON.parse('[1, 5, "false"]'); // [1, 5, "false"]
JSON.parse('null'); // null

MDN JSON.Parse details

Dory Zidon
  • 10,132
  • 2
  • 23
  • 37