Array Reduce in 100 seconds

preview_player
Показать описание
Learn JavaScript's Array Reduce method in 100 seconds. Take many things and reduce them down to one thing.

#JavaScript #100SecondsOfCode

Install the quiz app 🤓

Use code lORhwXd2 for 25% off your first payment.

My VS Code Theme

- Atom One Dark
- vscode-icons
- Fira Code Font
Рекомендации по теме
Комментарии
Автор

I love how you show the "vanilla" for loop in comparison. That gives complete context for reduce.

Oswee
Автор

If you omit the reduce's second argument, the loop will start at the second item, and the accumulator will be the value of the first item in the first iteration.

This is useful if you are just adding the values in a number array. If you are trying to reduce an array of objects to a number, you shouldn't omit the second argument (specially if you are using TypeScript, that sets the .reduce() return type to the second argument's type or, if omitted, the array type)

juliohintze
Автор

I love this one. Short (no bullshit), but yet fully explanatory. Absolutely fits the needs of a newbie or an advanced programmer, who wants to refresh his knowledge. Thank you!

rolikaseventysix
Автор

fireship: explains the reduce method in depth in 100 seconds
also fireship: tries to explain all of react in 100 seconds

waadlingpenguin
Автор

Thank you so much for this iv always struggled to understand reduce till now

Nyasha_Nziboi
Автор

I am liking these in 100 seconds clips. Thanks.

StephenMoreira
Автор

Really loving these short episodes as fillers. Cheers Jeff 🙏🏻

yourpersonaldatadealer
Автор

Starting to ask myself why I wasted hours of my life learning programming concepts only to discover your channel years later, explaining them better in 100 seconds each. Thanks for refreshing my memory on this and keep 'em coming!

stepsxa
Автор

The visual of your videos is just exceptional!

stoicfloor
Автор

I likes this format, maybe i can apply It to my videos too.
You are doing a great job😊

alberto.polini
Автор

As someone that uses js alot these are nice videos to help other people understand js, nice job :D

bullfrog
Автор

Thank you Fireship, for providing your VS Code theme and font in the video description!

berkeguzel
Автор

You guys are reading my mind! I just starred replacing regular forEach loop with reduce wherever I can

aleksandarstevanovic
Автор

Been working with js for a while and never really got the reduce method, thanks!

TheEnde
Автор

Reducers are so useful... once you got the concept you can do really great things with them

Noah-vmid
Автор

Great now I've to change my shopping cart function but I like better 😁 thanks Jeff 🤓 these short tips are useful 👌

will_abule
Автор

What a good explanation. Thank you so much!

Автор

This is very helpful
Thank you really for this short this clear explanation

easifier
Автор

Really enjoying these, excited for more 👍

randomcharacters
Автор

The true utility behind arr.reduce() is modifying different parts of the array based on the current value and/or index; not less typing vs. a for-loop.
Because a for-loop can do all a basic arr.reduce() method can, plus it can be made faster by doing a reverse for loop.

alekseysoldatenkov