3 ms·
I mostly end up using map, filter, for in and for of. Occasionally you still need a good “old fashioned” for loop but in my mind it’s more clear to use that the
by newshorts 5y ago
I mostly end up using map, filter, for in and for of. Occasionally you still need a good “old fashioned” for loop but in my mind it’s more clear to use that then forEach.
While loops have their own special powers for recursion so those are still appropriate and not something I would label as “old school” but hell, maybe that makes me old school!
I can’t find a ton of good personal examples where I’ve needed a range function.
This article feels more like the author was “exploring” techniques rather than proposing a standard practice