We all know you can do:
let arr1 = [1,2,3]; let arr2 = [3,4,5]; let arr3 = [...arr1, ...arr2]; // [1,2,3,3,4,5]
But how do you make this dynami
Another option could be:
const nArrays = [ [1, 2, 3, 4, 5], [6, 7, 8, 9], [10, 11] ]; const flattened = [].concat(...nArrays); console.log(flattened)