---
title: "Comment by Pavittar Singh on \"How forEach can be totally useless\" | Hashnode"
description: "I usually avoid forEach in JavaScript because it at times behaves weirdly. I prefer map, filter and reduce methods, or the plain classic or the while sometimes."
url: "https://hashnode.com/posts/how-foreach-can-be-totally-useless/615f6c358e8734462af5d755/comment/616b2abbb636526db5f484e5"
---

[Discussion](https://hashnode.com/posts/how-foreach-can-be-totally-useless/615f6c358e8734462af5d755)

Comment [How forEach can be totally useless](https://hashnode.com/posts/how-foreach-can-be-totally-useless/615f6c358e8734462af5d755)

[Pavittar Singh](https://hashnode.com/@pavittarx)

[Oct 16, 2021](https://hashnode.com/posts/how-foreach-can-be-totally-useless/615f6c358e8734462af5d755/comment/616b2abbb636526db5f484e5)

I usually avoid forEach in JavaScript because it at times behaves weirdly.

I prefer map, filter and reduce methods, or the plain classic or the while sometimes. 😅

[Marcelo Zárate](https://hashnode.com/@marcelozarate)

[Oct 20, 2021](https://hashnode.com/posts/how-foreach-can-be-totally-useless/615f6c358e8734462af5d755/comment/616b2abbb636526db5f484e5#reply-61708ae30c5e175a1c611c4d)

I usually avoid it in JS too!

Never underestimate the power of the classic syntax. It survived so many years and a lot of great software is built upon it.
