• Vehicles • Fashion • Recipes • Blogs • Hunt • Travels • Sport • Fun • Handmade • IT • Education
Mini-Games
x

x
zakruti.com » IT - Software » freeCodeCamp.org
Array Iteration: 8 Methods - map, filter, reduce, some, every, find, findIndex, forEach

Array Iteration: 8 Methods - map, filter, reduce, some, every, find, findIndex, forEach

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Learn eight methods to iterate through an array in JavaScript! Methods include: forEach, map, filter, reduce, some, every, find, findIndex. Code: - http://codepen.io/beaucarnes/pen/EZgLYL?editors=0012 More info: - https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff Beau Carnes on
Date: 2022-03-14

Comments and reviews: 9


Could this map explanation contain an error? Map doesn't return the result into the original array as it seems to be suggested here. Instead, map creates a new array and places the results in it. Which ends up having 2 arrays: three and double, respectively containing [1,2,3] and [2,4,6]. To verify this, simply add console.log(array) after console.log(double).
reply

People seem to have a hard time understanding that the functions map and filter return copies of the array with each element transformed element-wise by the callback function. Think about the difference between map and forEach and why you would use one over the other to solidify this. I'm going to start sending this video to anyone struggling with this.
reply

I must say i normally never comment on videos but this one was truly amazing. Super straight and understandable.
But where exactly is the difference between FIND and FILTER. For me FILTER is just the more versatil FIND am I right or am i missing something?

reply

Hi!! Just wanted to say that your videos are the best! Came to this one from the Javascript beginners video and both had helped me a lot. Everything you explain is so clear! Thank you very very much! And hope you can keep working on more videos!!
reply

OMG. I didnt know about all these. Thanks! And also, I just realized I have been abusing map() when I should have done forEach() .. smh..
does the => operator work for forEach as well btw?

reply

I paused this video in the last minute just to comment. Your tutorials are so amazing and straightforward. I dont know how to appreciate this better
reply

I've been looking everywhere for the .find function to actually work..and yours is the only one that worked and made complete sense....THANK YOU!
reply

Using the filter function, is it possible to move items to another array when they are clicked? If yes, how is it done please?
reply

The simplest, shortest and best array iteration tutorial ever-
after 1 year trying finally i understand it , i can't believe

reply
Add a review, comment






Other channel videos