As the heading suggests, I am facing an issue with setting an array from a string variable.
/*** ATTEMPT THAT FAILED ***/
var Multi = [];
var test = "[0,1],[1,5],[2,3],[3,10]";
Multi.push(test);
/*** SUCCESSFUL SOLUTION ***/
var Multi = [];
Multi.push([0,1],[1,5],[2,3],[3,10]);
I wonder why it doesn't work when saved as a string? It is crucial for me to make it work in a string format as I will be retrieving these values from another PHP file using AJAX.
Thank you.