News for hackers. Stuff that matters.
Re:FP techniques that will help you write better JavaScript by _notathrowaway on Friday February 11, 2022 @08:41AM (#30301336)
>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.

Re:FP techniques that will help you write better JavaScript by geokon on Friday February 11, 2022 @10:13PM (#30309598)
oh yikes sorry. I didn't realize JavaScript is so idiosyncratic. i was just kinda thinking from my c++ bubble i guess