Here is a string that needs to be converted into a JavaScript array:
['Value',2],['Value2',4],['Value3',10]
To convert this to a JavaScript array, the following code can be used:
var tmpStrings = "['Value',2],['Value2',4],['Value3',10]";
var arrStrings = JSON.parse("[" + tmpStrings + "]");
However, there are unexpected character errors thrown when trying to parse the string. It was initially thought that single quotes might be causing the issue, but escaping them did not solve the problem. Interestingly, parsing integers seems to work fine as seen in the code below:
var tmpInts = "[4,2],[5,3],[6,3]";
var arrInts = JSON.parse("[" + tmpInts + "]");