Quantcast
Channel: how to convert string into javascript array - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by jhhayashi for how to convert string into javascript array

function stringToArray(str) { return JSON.parse(str.replace(/'/g, '"'))}

View Article


Answer by Rajesh for how to convert string into javascript array

You can use JSON.parse to convert JSON to JS Objects/Arrays. Now issue is, your string has single quotes' and JSON.parse expects double quotes, so you will have to replace it.Another case can be, you...

View Article


how to convert string into javascript array

I have this string [['Kaufen Kaufen', 11.6024872, 50.96389749999999, 1], ['Demandware', -71.13296849999999, 42.4884618, 2],['Downtown TV Shop', -71.0661193, 42.3548561, 3], ['Electronics Super Store',...

View Article
Browsing all 3 articles
Browse latest View live


Latest Images