Where to learn about reduce(), map(), and filter()?

Hello! When working on “Use the Rest Parameter with Function Parameters,” I looked at the solution and found that I needed to use reduce(). I started out on the Algorithms and Data Structures certificate brand new to JavaScript and never learned about these in the curriculum. Where can I go to learn about these and more similar functions?

1 Like

HI @NightFire222 !

Welcome to the forum!

map, reduce and filter are more formally introduced in the functional programming section

1 Like

Thank you! Should I continue these sections in order, or is there an order you’d recommend I do the sections in?

I would continue to do them in order

Hey there!

In addition to the resources already shared I also found this multipart series very helpful when I was trying to wrap my head around these functions

1 Like

Those solutions are just possible solutions, they are not the solution and should not be taken as gospel. Don’t worry if your code looks a little different.

4 Likes

Thank you. I think one problem I am having with the ES6 lessons is that I simply have no idea what I’m doing.

2 Likes

I don’t remember where it is in the curriculum, but at some point they have you recreate all of the those higher-order array methods with for loops. As long as you understand for loops, you could recreate them all.

// sum elements of arr
const reduceSum = arr.reduce((a, b) => a + b, 0);

// also, sum elements of arr
let forLoopSum = 0;
for (let i = 0; i < arr.length; i++) {
  forLoopSum += arr[i];
}

What I mean to say is, don’t worry about it!

6 Likes

i myself like to understand the functions i use so here i found the full description for the .reduce() and the parameters it needs, scroll down till you find SYNTAX

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.