If I have an array that contains arrays within it, my goal is to flatten it and create a single array with all the values.
let arrWithArrs = [[1,2,3], [4,5,6]];
let array = arrWithArrs.map(arr => ...arr);
The current approach does not yield the desired result. How can this be achieved to get the following outcome?
array = [1,2,3,4,5,6];