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
As more powerful alternative to split, you can use match
split
"0,1".match(/\d+/g)
let a = "0,1".match(/\d+/g) console.log(a);