JavaScript Array Reduce
Vložit
- čas přidán 14. 05. 2018
- JavaScript Array Reduce
🔥Get the COMPLETE course (83% OFF - LIMITED TIME ONLY): bit.ly/2KZea52
Subscribe for more videos:
/ @programmingwithmosh
Want to learn more from me? Check out my blog and courses:
programmingwithmosh.com
/ programmingwithmosh
/ moshhamedani
Once again Mosh shows why he's one of the best coding teachers. You make things very clear, because you explain what EVERYTHING is, in laymen's terms. A lot of coding teachers forget they're teaching beginners.
Finally... Somebody who explains reduce well. MDN documentation didn't help me.
Just came from MDN 'cause I didnt understant a sheep!
Exactly.
You are very right! MDN didnt help at all...
Ikr he is awesome
So much clarity in 7 minutes video !
How am I only finding your tutorials now. You explain so well. I'm taking you with me for the rest of my Java script journey.
Been looking high and low for a simple explanation of the reduce method, and only now I have found it. Thank you.
Awesome , just understand what is the role of the "Accumulator" and the "Current Value" makes everything very clear. Thank man!
Thank you Mosh. I wish everyone can explain things as clearly as you.
This is by far the clearest explanation I've seen on the reduce method so far.. Thanks a lot Mr Mosh..
This is super detailed, yet simple to understand, just great!
Great tutorial, very well explained and easy to follow, I can finally say I understand the reduce method. Thanks you! Hope to see more tutorials like this in the future, like this key word, classes, call, bind, apply, etc.
Boss more blessing to you, love from Nigeria. You just explained all MDN couldn't in minutes
I spent 20 minutes on mdn understanding all this. I got more confused there.Thanks man
finally, I can totally understand the reduce method thanks to you, appreciate your channel
Took me a while to get reduce even after learning all the other iteration methods. Thank you!
I love he teaches coding very clearly in a short amount of time. He's the best coding teacher.
czcams.com/video/a_Bfu1XWGmI/video.html
You're the BEST Instructor I've ever come across +ProgrammingwithMosh
*sheds a tear* LOL :D -- I can't wait for more JS videos!!!!!
Cleanest explanation I've seen so far. You just earned yourself a sub.
Hadn't got used to that reduce method and was struggling for a while, only took me a minute of your explanation to spark a lightbulb in my head and I felt relieved. Thank you.
czcams.com/video/a_Bfu1XWGmI/video.html
Thank you, Mosh. I found this very helpful for grasping the concept of reduce().
Thank you Mosh. This is one of the best explanations about how to use reduce, that I could find on CZcams.
I've explored every single line of MDN reference, but I didn't learn as much I could get from you. Appreciate that mate
Thank you so much for this tutorial! Love the no-nonsense approach that any layman can pick up on :)
The English is just so perfect for a non-native speaker like me. The explanation is so easy to understand too. Thank you so much, you get my subscription!
Thank you for explaining this right! No one seems to explain the first callback value as the accumulator but yet as the previous value.
It would be great if you explain how the accumulation can be an array or object, and how when instead of chaining map and filter we can use reduce. I guess it's in the complete course.
If you were using an array, you could return an array in the reduce, and spread the accumulator. Then add any new value after. Example:
nums = [1,2,3,4,5]
const doubledNums = nums.reduce( (acc, num) => [...acc, num*2], [ ])
console.log(doubledNums) // [2,4,6,8,10]
Obviosuly a .map could do the same thing but there are more complex examples where it is useful.
@@liamwelsh5565 Hi, I'm very new to coding, may I know why did you add the "..." before acc? I'm not really sure what it does here
@@Xetron1978 … is the spread operator. If you have an array, let’s call x and want to make a new array, let’s call y, that has all the values of x, you can spread x into y.
Example:
Const x = [1,2,3]
Const y = […x]
Console.log(y)
// [1,2,3]
You can also spread objects into objects
This video is posted a long time ago, but for the first time i understand reduce. Thanks Mosh!
Mosh, thank you so much! You broke this down into a very easy to understand way.
This was VERY helpful and clear. Thanks, Mosh
By far the best explanation of reduce I have gotten haven watch tones of videos and tutorials
Excellent explanation. I was confused how it worked until I saw this. Keep doing what you're doing man!
Thank you Mosh!!! This ruled!!!
Can anyone explain why for loop or foreach is "old way" and reduce is more "elegant way"?
I find the"old way" more readable than the "elegant way"
understand the elegant way and use the readable way if you want, after some months you will like to use the elegant way
I also think the "old way" is better. The "elegant way" is limited to iteration of type y_n = f(y_{n-1}, x_n) where f is the callback function. There is this new movement in programming where people think old fashion for-loops are ugly code.
Hooray, finally someone explained normally .. thank you very much!
After watching this higher education, I was finally able to deeply understand it. Thank you!
Man, amazing explanation! So much better than some of the videos and websites I have seen on this topic!
The first tutorial that made me understand reduce method. Thanks.
wonderful explanation!!! tnx for been there Mosh!!!
Wow! Explained in a super easy way. Thank you.
Excellent breakdown as usual, cool new js feature
Easy and simple, thank you!
This is soooo helpful. Thanks Mosh!
Best code videos I ever watched. Thank you brother!
Thank you for making js clear and simple to understand
Thank you dude, this is incredible. I wasn't understanding this before watching your video, thank you.
That's exactly what I needed. Thanks.
Thank you so much, wonderful explain
Mosh is everything a newbie needs!!!
Thank you. Better than any video out there.
Finally ... some who explain reduce well .Thanks
Thank you very much for making this clear!
Best method of teaching reduce method from complicated to its simplest possible form all under 10mins. You are amazing good sir. Thank you
Thank you sir for explaining this so clearly.
Thank you very much for this explanation . It was really useful. Keep up the good work.
Finally!!! Well explained in details. You’re a good man
Thank you so much. This was such a huge help!
It was really clear explanation. Thanks a lot Mosh!
I was totally in the dark with this Reduce thing...thanks for explaining🙏 great help 👏👏👏
Wow, so clear. Thanks, Mosh!!
This is nice but it'd be great if there was something on how to use reduce when making new objects/arrays
Great vid , helped me to finally jump that mental hurdle.
Quite Good tutorial with some good examples how actually reduce works. Keep it up
Thank really. I was making a project. I am adding tips of bills as % to a calculation machine and i need to sum all tips and print. At the end i succeeded by looking to your tutorial. Thanks so much.
Wow, so I was trying to understand this by reading it on MDN and it was just not sinking in. This helped SO much! Thank you good sir.
I'm from Brazil, but you explained so well. Thanks a lot!
Thank you for breaking this down in detail. Very easy to understand.
Cheers, nice way of explaining things, I always pass ur videos when it pop ups now I watch and it's wonderful.
Simply superb!!!
Very well explained, thank you!
Awesome explanation! Thank you for this!
Thanks man! It helps me a lot.
Best... Thank you sir...love from india.♥️
You are a king in easy explaining
Literally just spent an hour trying to figure this out from reading on MDN. I understood beforehand how reducing works. I'm familiar with the concept from a few other languages, which implement it more elegantly through lambda expressions. Javascript syntax can be odd at first, and it all came down to simple syntax errors I was making.
This helped me so much, thank you!!!
Thank you so much brother,your explanation was very simple and clear
You are the best, man. Thanks!
thank you so much!
Thank you so much for the beautiful explanation of reduce the method.
Wow very clearly. Many thanks
Very helpfull and clear as well in the explaination MDN was making me crazy. Thanks mosh! :)
Having it explained in video form is so much easier for me than reading it. Thank you!
czcams.com/video/a_Bfu1XWGmI/video.html
I love it, easy to learn
This made my brain hurt a lot less than the lesson I was reading. Thank you!
thanks buddy for making concept clear
You explain very well. Thanks!
Great video on reduce(). Thankyou you have clear all my queries and doubts
Nice class, thanks for this content!
Tnx Mosh for perfect explanation
you have made it simple man ! kudos
very well explained, congratz !
Thank you for this awesome explanation!
you are an amazing teacher!!
Amazing!!! Thank u for breaking it down and explaining the components . Very helpful.
czcams.com/video/a_Bfu1XWGmI/video.html
thanks, for your clear explanation
This was great! thank you
one of the best explaination I ever watched
You are awesome Mosh!!
simple and great explanation Mosh.
Nicely explained, thank you
Dude this is the best. Thanks.
Hi, Mosh. It was really helpful. Thanks.