I'm looking for a good way to make sure numbers are NOT strings, before I convert it to a JSON. Any suggestions would be great. My current regex isn't quite right.
<script>
var str = '[2012,99],[2013,96],["2014","96.3"],["2015","98.7"],'; // need to ensure any stringed numbers are actually numbers.
str = str.replace(/"(\d)"/g, "$1"); // Make sure numbers are not represented as strings
str = str.replace(/,\s*$/g, ""); // remove comma at end of string
str = "["+str+"]";
console.log(str);
dataArray = JSON.parse(str); // Create output that google charts can use
console.log(dataArray);
</script>