I need to convert a string representation of array to JS array for looping purpose the string is single quoted
in My js
var length1 = $('.length').text(); //['2018-9-24', '2018-9-26', '2018-9-25']
console.log(length1.length) // 39 as output i need it as 3
to loop through each date
Any help would be appreciated
I tried
var myArray=json.parse(length1) // but its not working