Saturday, May 25, 2024
 Popular · Latest · Hot · Upcoming
91
rated 0 times [  94] [ 3]  / answers: 1 / hits: 19943  / 12 Years ago, wed, april 4, 2012, 12:00:00

I have a string representation of an array:



'[item1, item2, item3]'


I'm trying to convert this back to an array.



Any pointers appreciated.


More From » javascript

 Answers
674

Just use JSON.parse('[item1, item2, item3]');


[#86434] Monday, April 2, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
braidenv

Total Points: 80
Total Questions: 104
Total Answers: 91

Location: Peru
Member since Fri, Oct 14, 2022
2 Years ago
;