Reduce: Mother of all Javascript Array Methods? (Part 5)

Reduce: Mother of all Javascript Array Methods? (Part 5)

Jack Herrington

2 года назад

15,690 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@mikef.606
@mikef.606 - 13.05.2023 20:41

This is better than Netflix.

Ответить
@tarekmagdy5775
@tarekmagdy5775 - 23.03.2023 00:02

why i dont understand this reduce at all :(

Ответить
@jeyosman1
@jeyosman1 - 22.12.2022 21:21

what extention are you using to see the values live?

Ответить
@muhammadyousufhere
@muhammadyousufhere - 22.10.2022 19:42

Can't believe!! You literally have summed up almost everything Js in one video.

Ответить
@asadsiddique5527
@asadsiddique5527 - 28.08.2022 11:17

Hay Jack, can you tell me how are your printing array values just before it?

Ответить
@nkrprahan
@nkrprahan - 09.08.2022 12:10

You are too good Jack!! The way you have compared all the array functions with reducer. Reduce indeed can replace most of the array functions which helps in grasping the concepts. Thanks. What vs extension you are using to see the output on the vscode screen?

Ответить
@mdrahiem_dev
@mdrahiem_dev - 20.06.2022 09:12

I wasn't confident about reduce method till now.. thanks much for the video..

Ответить
@mostafakheder7721
@mostafakheder7721 - 09.06.2022 18:27

i think reduce is not the mother of all array method it is here mother in low >>>> its complicated

Ответить
@vigyanhoon
@vigyanhoon - 07.06.2022 08:52

No doubt reduce is mother of all but it is also mother of all complex looking code too! :)

Ответить
@usamaimran1516
@usamaimran1516 - 22.05.2022 11:32

What is that extension, that gives output right after function definition?

Ответить
@lookingforbino
@lookingforbino - 22.04.2022 19:11

Which extension did you get for showing that each step is going on under the hood?

Ответить
@LuisFelipe-td8qk
@LuisFelipe-td8qk - 15.03.2022 15:40

Come on, Jack! You are a blessing for all programmers. Thank you so much, I think I'm about to finish all of your videos.

Ответить
@MarkDekkersLife
@MarkDekkersLife - 05.03.2022 17:23

I love your teaching even more than your music. Thanks Macklemore!!

Ответить
@basharkhadra2929
@basharkhadra2929 - 30.01.2022 06:00

100% coverage of reduce functionality.
Thanks a lot 👍

Ответить
@user-ze1zp9cp5u
@user-ze1zp9cp5u - 08.01.2022 17:13

Reduce is my favourite method for arrays. So powerful especially when initializing an object but at same time looping through the array. Love the series!

Ответить
@ryosukekureha4873
@ryosukekureha4873 - 04.12.2021 11:08

잭 형
최고!

Ответить
@GurbyTheGreat
@GurbyTheGreat - 04.12.2021 08:34

The problem with reduce is that unless the function inside is extremely simple, readibility is sacrificed.
You are better off using for...of or for...in

Ответить
@designdeveloprepeat651
@designdeveloprepeat651 - 03.12.2021 05:57

Great video as always!

Ответить
@ahmedmuhammedelsaid5345
@ahmedmuhammedelsaid5345 - 02.12.2021 21:10

the best ever

Ответить
@maltegb
@maltegb - 01.12.2021 14:24

Great Content, keep up!

Ответить
@adamlerman4173
@adamlerman4173 - 01.12.2021 12:41

Thank you for another awesome video!

Ответить
@user-gh6tc1bf9h
@user-gh6tc1bf9h - 30.11.2021 23:28

absolutely complete stuff !! keep going !

Ответить
@MrPlaiedes
@MrPlaiedes - 30.11.2021 17:25

Great video man!

Ответить
@marcelsdev
@marcelsdev - 30.11.2021 15:16

Great comparison examples! "Mother" will be proud! :D

Ответить
@aksyonov100
@aksyonov100 - 30.11.2021 00:09

Nice video Jack as usually! As you said reduce should be used with caution, don't just use it everywhere because it's cool. Good example with lookup, complexity with for-of is O(n) but with reduce you will get O(n^2) .

Ответить
@raresraulea5455
@raresraulea5455 - 30.11.2021 00:05

Hi, Jack. On your last example (the reduce hack), two questions:
1. How come that we are also getting the last id resolved? When we are on index 0, value 10, we are awaiting for Promise.resolve() defined as the starting accumulator, at index 1 and value 20, we are awaiting for resolved id 10 returned from first iteration and on the last index 2 with value 30 we are awaiting for the resolved id 20 returned by the promise from the second iteration. So where is the await for the last Promise executed? Does reduce use iterators behind the hood, and awaits the last promise from the accumulator when the iterator has value: undefined and done: true?
2. What is the difference of initialising the accumulator with new Promise() or Promise.resolve()? Also in this chapter, whats the difference between resolving a promise with provided resolve method (from the parameters) and using the static method of the Promise class?

Thanks a lot!

Ответить
@AbdelhameedG
@AbdelhameedG - 29.11.2021 23:56

Amazing Jack, Keep it up you are definitely the leader of JS/TS/React/Frontend community.

Ответить
@burgasdragonheirsilentgods
@burgasdragonheirsilentgods - 29.11.2021 22:02

Amazing !

Ответить
@johannsebastianbach3411
@johannsebastianbach3411 - 29.11.2021 21:45

Wow that async reduce hack sure is smart!! Great video as always!!

Ответить
@mani8586
@mani8586 - 29.11.2021 21:14

Perfect video for Reduce...the mother of all functions 😅

Ответить
@theyreMineralsMarie
@theyreMineralsMarie - 29.11.2021 21:05

Reduce in JavaScript is actually really easy because the parameters arent typed. You can just throw anything in for the identity and then change it however you want on each iteration.
I like using reduce to convert and array of objects to an object with specific keys.

Ответить
@atilkan
@atilkan - 29.11.2021 20:29

How reduce performs when compared with other array methods and regular for loop?

Ответить
@shinmessiah
@shinmessiah - 29.11.2021 20:01

Great content and explanation sir as per usual

Ответить
@dgcp354
@dgcp354 - 29.11.2021 19:16

One of your typescript challenges where to do everything other methods do with reduce method, I was blown away when I learned it

Ответить