javascript - split comma for each entry in array -
any better ideas of converting
["1","2","3,4","5","6","7,8,9"]
["1","2","3","4","5","6","7","8","9"]
what want achieve create smaller amount of code while keeping simple.
var arr=["1","2","3,4","5","6","7,8,9"]; var tmp=[]; for(var i=0,len=arr.length;i<len;i++){ tmp=tmp.concat(arr[i].split(",")); }
http://plnkr.co/edit/ijg2apz3jafvsulxjdqe?p=preview
i used simple js can use kind of library reduce code.
Comments
Post a Comment