I have this JavaScript array:
[ \"124857202\", \"500255104\", \"78573M104\" ]
I want to convert this particular array into an array of obje
Another approach - Array#reduce.
Array#reduce
var arr = ["124857202", "500255104", "78573M104"]; var res = arr.reduce(function(s, a){ s.push({name: a}); return s; }, []) console.log(res);