Array flat and flatten with depth
Comes up in: Coding, DSA
This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.
What it covers
- recursive and iterative (stack) versions
- depth parameter
- Infinity
- holes
Words you will know
What you will practise
- implement
- iterative version
Interview questions this answers
- Implement
Array.prototype.flatwith a depth argument, iteratively.