Convert string with commas to array
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 case shows . If it where an array, it would show . And if is called, it should pop-up alert
0,1
0
alert(array[1])
1
Is there any chance to convert such string into a JavaScript array?