---
title: "Comment by D S on \"JavaScript Tips and Best Practices\" | Hashnode"
description: "Solid Article! The only qualm I&#39;ll take is with #5 as it seems junior level devs already overuse .map() . .forEach() is a more analogous solution vs a for l"
url: "https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6/comment/60e1ec9103707d644a5033bb"
---

[Discussion](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6)

Comment [JavaScript Tips and Best Practices](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6)

[D S](https://hashnode.com/@dstutts-dev)

[Jul 4, 2021](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6/comment/60e1ec9103707d644a5033bb)

Solid Article! The only qualm I'll take is with #5 as it seems junior level devs already overuse `.map()`. `.forEach()` is a more analogous solution vs a `for loop`. Map, filter, and reduce have their applications and are really nice for, like you said, one lining code, but I feel map in particular is overused.

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi)

[Jul 4, 2021](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6/comment/60e1ec9103707d644a5033bb#reply-60e1eea103707d644a503449)

Thanks [D S](https://hashnode.com/@dstutts-dev).

I totally get your point here. In my opinion, in most cases it depends on your use case.

`map()` creates a new array populated with the results of calling a function on every element in the calling array whereas `forEach()` method executes a provided function once for each array element.

So Basically, if you want to obtain a modified form of the previous array, you can sure short go for `map()`, if you don’t want that, you use `forEach()`

[Niranjan Borawake](https://hashnode.com/@niranjandb)

[Jul 4, 2021](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6/comment/60e1ec9103707d644a5033bb#reply-60e1fb5403707d644a5035e2)

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi) This is so true. I have infact explicitly written about it - [When not to use map](https://blog.niranjanborawake.in/when-not-to-use-array-prototype-map)

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi)

[Jul 4, 2021](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6/comment/60e1ec9103707d644a5033bb#reply-60e1fbf903707d644a5035fc)

[Niranjan Borawake](https://hashnode.com/@niranjandb) Great explanation Thanks for sharing
