4 ms·
Agreed, especially depending on the functional programming background of people involved in a project. In one project my guideline simply became `for (of)` is
by WorldMaker 9y ago
Agreed, especially depending on the functional programming background of people involved in a project.
In one project my guideline simply became `for (of)` is welcome, `for (;;)` is not. If you are too busy worried about index numbers as `for (;;)` is, you may be missing the big picture (and doing a lot of "useless" math), `for (of)` at least is relatively high level, and with Iterable support `for (of)` gives you more room to more easily move things out of the loop and into higher-order iterable functions before the loop.
Also with async/await, `for (of)` can sometimes be a lot easier to reckon with than higher order functions. People don't easily grasp Promise combinators, but `for (of) { const thing = await process() }` is readable for most everyone.