JavaScript Developer — Medium
Key points
- The flat() method flattens arrays by a specified depth
- In this case, the depth is set to 1
- Only the first level of nested arrays is flattened
- The output removes one level of nesting
Ready to go further?
Related questions
