Explorer
Node.js

Write a function `flattenDeep(arr)` that completely flattens a deeply nested array.

Problem Statement

Write a function `flattenDeep(arr)` that completely flattens a deeply nested array.

Complexity

Time Complexity: -

Space Complexity: -

Hints

šŸ’” Hint 1: Array.flat() accepts a depth argument. šŸ’” Hint 2: Use Infinity to flatten all levels. šŸ’” Hint 3: return arr.flat(Infinity); āœ… Solution: ```javascript function flattenDeep(arr) { return arr.flat(Infinity); } ```

Flatten Array Deep

Easy
Write a function `flattenDeep(arr)` that completely flattens a deeply nested array.
Editor
Loading Editor...
Evaluate code
Output:Click "Run" above to execute and verify your code here.
[1,2,3,4,5]