Which code should I use on js to map an array with spliting cells yet not reapeating [\"12,3\",\"3\",\"5\",\"66,22\"] into [\"12\",\"3\",\"5\",\"66\",\"22\"]<
[\"12,3\",\"3\",\"5\",\"66,22\"]
[\"12\",\"3\",\"5\",\"66\",\"22\"]<
I believe that you miss one 3 element in your desired output, if so - try following solution:
3
var arr = ["12,3","3","5","66,22"], res = [].concat(...arr.map(v => v.split(','))); console.log(res);