3 ms·
>forEach emphasizes you are operating on each element of the loop in a semi-independent fashion and you explicitly don't have access to any kind of intermediary
by _notathrowaway 5y ago
>forEach emphasizes you are operating on each element of the loop in a semi-independent fashion and you explicitly don't have access to any kind of intermediary index/iterator variable.
I disagree with this point, specifically for JavaScript the for...of syntax is more pleasant to read and also does not infer that any index access is gonna be done. And as a plus, it is easier to be used with async/await.
- geokon 5y agooh yikes sorry. I didn't realize JavaScript is so idiosyncratic. i was just kinda thinking from my c++ bubble i guess