In this video, I cover the JavaScript array function reduce().
🎥 Next Video: https://youtu.be/qmnH5MT_luk
🔗 MDN’s Array Documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
🚂 The Coding Train website: http://thecodingtrain.com/
💖 Support this channel on Patreon: https://patreon.com/codingtrain
🛒 To buy Coding Train merchandise: https://www.designbyhumans.com/shop/codingtrain/
📚 Book recommendations: https://www.amazon.com/shop/thecodingtrain
💻 https://github.com/CodingTrain/Rainbow-Code
🎥 For an Introduction to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
🎥 For More Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
🔗 https://p5js.org/
🔗 https://processing.org
📄 Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
Original source
40 responses to “16.7: Array Functions: reduce() – Topics of JavaScript/ES6”
@11:45 once he got here i cracked up by his fear of the code. Thats how we all are in my web dev elective at state rn LMAO
7:35 min and max in pure JS would be (thanks to the ES8 Spread Operator) Math.min(…array); or Math.max(…array);
People with deep knowledge will explain things as simple as possible, you are an example
Thank you sir.
no matter how I like your courses, I found this topic more fun and useful here https://youtu.be/1DMolJ2FrNY .. this time..
ssssooooooo wesome explanation
I know kung fu ….
Thank you for this, I understand it now
To people who want a much clear understanding of where the accumulator and val comes from see this
https://youtu.be/g1C40tDP0Bk
ARE YOU THE BEST TEACHER EVEr ?
Thank you, man! The internet has changed the way programmers learn!
Thanks for this video it helps me a lot but can you also explain the Grouping objects by a property using reduce as the example in MDN make me so confused 🙂
you're aweosme! thanks
Natural born teacher
which editor are you using??
I love the way of your teaching👌👌,,Best Teacher🏆
Nice Work Keep
summation using reduce < pre 7:33 post > find max using reduce
Thanks to youtube and people like you; anyone across globe is getting best quality knowledge absolutely free of cost.
3:20 why are you not using initializer value for reduce method ? Is it optional ?
nice intro lol!!
In Lisps, to do the reduce of a list of numbers is as simple as
(Apply ‘+ ‘( 1 2 55 7))
I really really like your video, thank you so much for the efforts you had put in this video to make it so clear.
i still don't understand about zero become a second argument
Such a brilliant tutorial!
a > b ? a : b
is equivalent to
a > b && a || b
in most c-family languages.
Excellent explanation!
Mr.Peanutbutter
Honestly, I've been trying to understand HOFs that use HOFs and all kinds of mind numbing stuff for a guy who has just started learning JS in the past few months. Thank god I found this crazy dude. He is the funniest / most entertaining I've found so far.
biggst
3:28 here can anyone answer how that function sum() adds array we have no information about array in that function sum
I was trying to see the difference between your reducer example and just using a map function, but I guess that is where the accumulator comes in. The accumulator persist over all the iterations where in a map function, you would have to create a variable outside the function and in each iteration of the map function you could do math on that variable and change it accordingly but the reducer function provides that extra variable and allows you to use on each iteration. Nice. Thanks!!
is there some way how to see all steps that reduce do ? I want to see how it works step by step.. btw: great intro ! 😀
You are amazing Teacher!!!!
man you great
Thank you so much! Finally, I got what reduce function is all about and how it works!
Beautiful <3
9:03. Does val>acc here means 9>5?
Эмм.. самое забавно то, что я мало понимал о чем он говорит. Но черт возьми! Он круто обьясняет, даже я понял суть reduce
My head just exploded. If I see code like this I'll probably be lost. #noideawhathappenshere