16.7: Array Functions: reduce() - Topics of JavaScript/ES6
HTML-код
- Опубликовано: 1 июл 2024
- In this video, I cover the JavaScript array function reduce().
🎥 Next Video: • 16.8: Array Functions:...
🔗 MDN's Array Documentation: developer.mozilla.org/en-US/d...
🚂 The Coding Train website: thecodingtrain.com/
💖 Support this channel on Patreon: / codingtrain
🛒 To buy Coding Train merchandise: www.designbyhumans.com/shop/c...
📚 Book recommendations: www.amazon.com/shop/thecoding...
💻 github.com/CodingTrain/Rainbo...
🎥 For an Introduction to Programming: • Start learning here!
🎥 For More Coding Challenges: • Coding Challenges
🔗 p5js.org/
🔗 processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
"I reduced myself to talk about reduce()" 10/10 teacher.
Hahaha
i touch my lit- sis like that ..now i pain too.
He’s the best! So endearing! His enthusiasm is contagious
1st time I actually understood reduce(). I always used the for loops to find min or max of something, but a new world opens.
Yup, I'm going to be busy rewriting lots of stuff!
what's best about his way of teaching is that he's learning with us!
this guy is sooooo freaking awesome....I can't imagine myself confused after watching any of his videos no matter how difficult the topic is. Hoping you expand content to cover even more concepts and languages. best of luck!!
Goddamn, I'm so glad I found your channel! I was so freaking confused about arrow function ternary operator syntax and you explained it in a way that was so easy to understand.
Arrays:
0:47-1:18 coding traditional summation function
1:55-6:06 how reduce function works
6:06-7:13 reducing code (ES6)
7:29-9:28 coding traditional max function
9:28-12:50 reducing code... 10:02-11:40 ... further with ternary operator
13:04-13:49 reduce's "assumed initial value"
This dude is out of breath he is so hype. Love it! I understand you perfectly where I couldn't elsewhere.
This seems to be the best explanation I've found so far. Thank you!
I can't stop laughing at the intro XD
Tushar Sadhwani HELLO I'M TINY
This has been an amazing experience . I love how you broke everything down, i was so confident with the syntax at first but seeing you wait the function first and then break it down and put it into the reduce parameter really helped. Thank you so much for this video-!!!!!!
You explained this so well, I was trying to wrap my head around it reading the documentation and couldn't understand it. I almost gave up completely. Thank you so much.
Thank you for doing what you do. As someone who is switching careers and trying to get into school, I felt genuinely lost until I stumbled upon The Coding Train. I'm all aboard buddy, keep chugging.
Thank you so much! Finally, I got what reduce function is all about and how it works!
People with deep knowledge will explain things as simple as possible, you are an example
I love how you're learning with us! You always say exactly what I'm thinking
these are great videos. you're goofy as all can be, but the way you make errors and then go through why the error is there and you explain the error and also explain the fix. This helps me out so much. good work
Everyone one of this guys videos is therapeutic on a level that’s hard to describe. Pure love…
This was super helpful and I think you did a great job explaining it! It made the MDN documentation make sense.
I never seen better explanation for reduce function.
Thank you so much.
Just started watching your videos yesterday, have developed into a really big fan!
thank you so much man!!! I was looking for the logic explanation at 12:36 for the past 4 hours but nobody could make it clear as you did. Now it's clear as a day.Thanks again!!! Take care!!!
Thank you, man! The internet has changed the way programmers learn!
Found my new favorite code explainer. Thinks the way I think when I'm trying to figure stuff out.
It's clicking for me today.
Thank you for all of your videos.
first time I've seen the outro and it made me smile so much!
Far way the best teaching videos I ever seen! You explain in such funny way!!
I love your videos
He is truly a dedicated and passionate teacher
the best video so far that i saw about reduce. thanks
THANK GODDDDDDD!! I WAS RACKING THE WRITTEN DOCUMENTATIONS WITH NO RESULT FOR 5 HOURS!!! AND YOU ANSWERED ME FOR 14 MINS!!
Great explanation! it STICKS now! Thank you!
I love the way of your teaching👌👌,,Best Teacher🏆
This is the first ever video I've come across that explains the exact concept and how it works, step by step, oh man why didnt I find you and this video much sooner, I'm subscribed lol. In struggling with JS alot fyi and look forward to checking all your videos. Thanks man
I love this. You're really entertaining and I'm learning so much!!!!
Daniel, the crazy uncle that everyone needs!
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 really liked this video, already watched it a few times all the way through. Thanks for the great explanations, it's great how you show your train of thought and all the steps. Your level of crazy is much appreciated also.
thanks so much for all these videos on array methods!!!! helps make them make sense
Great explanation. Its the hardest built in function anyway because it can be used in various problems
Man, thanks for this! No book explains this properly!! Guess I jumped on the coding train by subscribing :)
Smoothest intro I have ever seen.
Thank you! 🙏💕, it took me years to understand this until I watched your video
12:32 is really awesome. Great explanation, thanks for sharing your knowledge and it's funny to think that you're learning with us but you can make an app in 15 mins lol.
Nice tutorial I am so confident about the then jargon reduce () method.
One of the best, if not the best out there. Thank you
Thank you so much for this one! I was struggling with reduce() until now but not anymore!
The best intro I have even seen in my life🤣
Thanks to youtube and people like you; anyone across globe is getting best quality knowledge absolutely free of cost.
Unmatched energy! 👏🏾
The only video of yours that I grasp, I'm improving maybe ?.. Your other video is too advance for me, I want to be like you.. You are such a genius.
Your video helped me understand reduce. thanks a lot!
Best explanation technique ever seen 👍🏻
What a solid explanation. Thank you! Love your videos :D!
This looks like a really promising channel to learn, thank you.
it was challenging for me to understand reduce() you are my favorite teacher ever :D I enjoyed your video and I actually learned, thanks man
Glad I found your channel, really nice and helpful video! :D
Outstanding job and explanation!
Great video, thanks for sharing! It helped me a lot!!
I love you, Dan! You're the best!
This was the best video about reduce method ever
this is the best technique for teaching students.
Thank you, I understood everything.
Thanks for making this video!
I find your tutorials the easiest to follow while learning Js.
You should definitely start a podcast!
Wow you amazing man and your explanation have many ways to give idea for one time. I do appreciate your video I will watching all your video from now because my work depends on this videos....😘❤😘
Estuvo asombroso y logré comprenderlo 10/10
Thanks for help understand reduce() function
trying to wrap my head around following when i saw your video, thanks it helped:
const pipeline = (...fns) =>
(value) =>
fns.reduce((acc, fn) => fn(acc), value)
const celsiusMult = (number) => number * 9/5
const celsiusAdd = (number) => number + 32
const fahrenheit = pipeline(celsiusMult, celsiusAdd)
fahrenheit(100)
// 212
I just LOOVE his introduction😆
finally it makes sense! Thank you so much!!!!
.Reduce() gives you the ability to iterate over the array while keeping track of current index and previous index.
thank you!
thank you so much , u made it so easy to understand
Reminds me of the c++ stl library algorithms using lambda expressions. Really nice way to write compact and fast code. Great to see it coming to JS as well.
Collin Kreutzer it's not new fyi
You got that backwards. C++ was one of the last languages to use functional ideas.
Matthew Hoiland
C++11 released lambdas.
ES2015 released arrow functions
You’re wrong pal
Excellent explanation!
You're an amazing teacher 👏😃😃
fist video of this channel I've ever seen (already subscribed)... for a brief moment I thought it was jeff Goldblum teaching coding! lol.. awesome video, I love the energy
You are the man. Thanks for your video
the best video of reduce method!
I was close to give up finally light at the end of the tunnel. Thank you
The .reduce() method has never been this entertaining!
this helped me a lot. thanks!
best part of the video at 6:15 the way you broke the function
Super helpful, thank you!
You are amazing Teacher!!!!
you are a great teacher sir
I played around a bit and this is what I made:
_array.reduce((acc, val) => Math.min(acc, val))
_array.reduce((acc, val) => Math.max(acc, val))
they way he teach, have me excited as well
I'm so glad to hear!
I am thankful to you. Thanks!
you have the best videos ever I love you thank you
very good explanation, thanks
Thank you for this, I understand it now
what are you?!?!?!
some kinda magician?! that was so damn good. you explained it so well, man. thanks.
Best coding teacher ever
Thank you,my code looks now better and cleaner
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!!
You are the living end. I love your instruction, it's great. #bestofyoutube
Thank you for this video that was so usefull.
Очень круто!!! Спасибо!
well explained....bravo
"I could probably use this thing called a ternary operator if I was a crazy person."
I just love you man!!