Array Flatten in JavaScript
You’re working with an API response, everything looks fine… until it doesn’t.
Instead of a clean list, you get something like this:
const data = [1, [2, 3], [4, [5, 6]]];
Now you just want:
[1, 2, 3,
yashika29.hashnode.dev8 min read