---
title: "Discussion on \"How forEach can be totally useless\" | Hashnode"
description: "Discussion on \"How forEach can be totally useless\". javascript forEach is not a function (?)"
url: "https://hashnode.com/posts/how-foreach-can-be-totally-useless/615f6c358e8734462af5d755"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How forEach can be totally useless](https://marcelozarate.com/how-foreach-can-be-totally-useless?utm_source=hashnode&utm_medium=feed)

javascript forEach is not a function (?)

Oct 7, 2021 · 3 min read · marcelozarate.com  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#newbie](https://hashnode.com/tag/newbie)
-   [#programming-tips](https://hashnode.com/tag/programming-tips)
-   [#python](https://hashnode.com/tag/python)
-   [#2articles1week](https://hashnode.com/tag/2articles1week)

## Written by

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

@marcelozarate · La Pampa, Argentina

  
[View profile](https://hashnode.com/@marcelozarate)

A bit of everything & a lot of nothing developer

## Responses 2

Markdown supported · ⌘↵ to post

[Diego Baratta](https://hashnode.com/@Hackkpo)

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

Hahaha I'm flattered to be such inspiration to you with this article. It's dumb of me to program all this years without even knowing the foreach's existance... But now with this I know a little more. Txs and keep the good teaching ^^

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

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

It's not dumb at all! As I said

> "go by so many years without using it and by no means being powerless in his ability to make quality code."

Thanks for the inspiration and for stopping by!

[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.
