I want to convert below string to an array in javascript.
{a:12, b:c, foo:bar}
How do I convert this string into array of objects? Any cool
JSON.parse will do the trick. Once parsed, you can push them into the array.
var object = JSON.parse(param); var array = []; for(var i in object) { array.push(object[i]); }