Given the array: [[1,2,3], [4,5,6]]
How to transformer in: [1,2,3,4,5,6]
Given the array: [[1,2,3], [4,5,6]]
How to transformer in: [1,2,3,4,5,6]
var x = [["1", "2", "3"], ["3", "4", "5"]];
var y = x[0].concat(x[1]);
You can do this as follows:
var matriz = [
['A', 'B', 'C'],
['D'],
['E', 'F'],
['G', 'H', 'I', 'J']
]
var array = matriz.reduce((list, sub) => list.concat(sub), [])
console.log(array)