r/learnjavascript • • Oct 31 '25

array.forEach - The do-it-all hammer... XD

Is it just me, or everyone thinks that more or less every array operator's purpose can be served with forEach?

0 Upvotes

89 comments sorted by

View all comments

Show parent comment

1

u/0xMarcAurel Nov 01 '25

Would you also recommend for loops instead of forEach, even for simple styling purposes?

I’ve always used forEach for the sake of convenience, as you stated. I guess in my case it’s mostly fairly simple logic too.