Flattening Nested Arrays in JavaScript
Introduction
You’ll often run into arrays like this:
const arr = [1, [2, 3], [4, [5, 6]]];
At first glance, it looks fine. But the moment you try to process it — loop, sum, map — things get messy.
Be
extrajs.hashnode.dev3 min read