What is the reduce() method in Javascript used for? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

What is the reduce() method in Javascript used for?

How is it different from map() method and filter() method?

10th Dec 2020, 7:21 PM
Logos
Logos - avatar
3 Réponses
+ 5
Reduce the most advanced of all these methods.. its usage can be so versatile, in simple view .. it "reduces" the arrays it's applied on to *a single value* this value can be a number, a string or.. another array I suggest you go to the MDN documentation covering its usage .. and try to practice it more (you won't fully get it, till you use it) via challenges on edabit for example
10th Dec 2020, 10:23 PM
Ali Kh
Ali Kh - avatar
10th Dec 2020, 11:31 PM
Kevin ★
+ 2
Ali Kh and Kevin ★ Thanks a lot. I'll do well to use the resources aforementioned.
13th Dec 2020, 1:06 PM
Logos
Logos - avatar