I have a string as shown below
[{ date: new Date(2015,9,25), NAV: 12},{ date: new Date(2016,9,25), NAV: 22}]
how can i convert that to object array using jQuery?
Since new Date(2015,9,25) is not valid JSON, than you need to use eval(yourString) to parse your string to valid Object:
console.log(eval('[{ date: new Date(2015,9,25), NAV: 12},{ date: new Date(2016,9,25), NAV: 22}]'));
try this,
var obj = $.parseJSON(jsonString);
or
var obj = jQuery.parseJSON(jsonString);
may be this might help
you can convert it to json.parse:
var json = $.parseJSON(myString)
or you can refer this link below
new Date(2015,9,25)part of your string? If it is, it will throw error.