-1

For example: '[test,abc,123]'. How do you turn that into a standard javascript array that can be iterated?

Jarg7
  • 1,588
  • 2
  • 13
  • 23
  • 2
    That's not a stringified array. Fix whatever's giving you that essentially broken input so that it gives you JSON instead, then parse the JSON – CertainPerformance Feb 22 '20 at 03:22

1 Answers1

0

This will work, but really you should fix your input to give you real JSON as is noted in the comments.

console.log(JSON.parse('["test","abc",123]'));
Jonathan Rys
  • 1,782
  • 1
  • 13
  • 25