un-nest nested arrays
Examples
const arr = [[1], [2]]; console.log(flatten(arr)); // [1, 2]; const arr2 = [1, [2], [3, 4, [5]], [[6,[7]]]; console.log(flatten(arr2); // [1, 2, 3, 4, 5, 6, 7];
Generated using TypeDoc
un-nest nested arrays
Examples
const arr = [[1], [2]]; console.log(flatten(arr)); // [1, 2]; const arr2 = [1, [2], [3, 4, [5]], [[6,[7]]]; console.log(flatten(arr2); // [1, 2, 3, 4, 5, 6, 7];