---
title: "Discussion on \"A Brief Introduction to JavaScript Map, Filter and Reduce Methods\" | Hashnode"
description: "Discussion on \"A Brief Introduction to JavaScript Map, Filter and Reduce Methods\". JavaScript Map, Reduce and Filter Functions\nIntroduction\nArrays are important Data Structures in programming. All the methods which we are going to discuss in this article will iterate over an array and return a new array based on the result function..."
url: "https://hashnode.com/posts/a-brief-introduction-to-javascript-map-filter-and-reduce-methods/5f0c090c3fe8405bdb8d8194"
---

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

Discussion

# [A Brief Introduction to JavaScript Map, Filter and Reduce Methods](https://blog.nemotivity.dev/a-brief-introduction-to-javascript-map-filter-and-reduce-methods?utm_source=hashnode&utm_medium=feed)

JavaScript Map, Reduce and Filter Functions Introduction Arrays are important Data Structures in programming. All the methods which we are going to discuss in this article will iterate over an array and return a new array based on the result function...

Jul 13, 2020 · 4 min read · blog.nemotivity.dev  
Updated Aug 4, 2020  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#es6](https://hashnode.com/tag/es6)
-   [#2articles1week](https://hashnode.com/tag/2articles1week)

## Written by

[Subha Chanda](https://hashnode.com/@nemo)

@nemo

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

Technical Writer | Developer

## Responses 2

Markdown supported · ⌘↵ to post

[Michael Geary](https://hashnode.com/@Geary)

[Jul 21, 2020](https://hashnode.com/posts/a-brief-introduction-to-javascript-map-filter-and-reduce-methods/5f0c090c3fe8405bdb8d8194/comment/5f1693ade37a46613e6fe777)

```
const sum = arr.reduce((result, item) => {
  result = result + item;
  return result;
});
```

Since `result` is local to the callback, you can simplify this to:

```
const sum = arr.reduce((result, item) => {
  return result + item;
});
```

[Subha Chanda](https://hashnode.com/@nemo)

[Jul 21, 2020](https://hashnode.com/posts/a-brief-introduction-to-javascript-map-filter-and-reduce-methods/5f0c090c3fe8405bdb8d8194/comment/5f1693ade37a46613e6fe777#reply-5f16f59ce37a46613e6feaa1)

Thank you for the suggestion. 😊 I was thinking to use this code, const sum = arr.reduce((result, item) => result + item); But because it's not much beginner-friendly, so I chose to go with the one above.

[Bolaji Ayodeji](https://hashnode.com/@bolajiayodeji)

[Jul 13, 2020](https://hashnode.com/posts/a-brief-introduction-to-javascript-map-filter-and-reduce-methods/5f0c090c3fe8405bdb8d8194/comment/5f0c58731c0d706231f7640c)

Really insightful, thanks for sharing.
