How can I convert a string to a JavaScript array?
Look at the code:
var string = \"0,1\"; var array = [string]; alert(array[0]);
In
This is easily achieved in ES6;
You can convert strings to Arrays with Array.from('string');
Array.from("01")
will console.log
['0', '1']
Which is exactly what you're looking for.