- [Narrator] The final built-in array function … that we're going to discuss is called reduce. … The purpose of this function … might not be quite as apparent as map, filtered or sort. … But reduce is definitely just as useful as, … if not more useful than the other array functions. … What reduce allows us to do is take an array of data, … and reduce it down to a single value. … So for example, we could take an array of numbers … and reduce it down to a sum or an average. … Essentially, what reduce does … is starts with an initial value, say zero, … and for each element in the array, … it modifies its initial value in some way … until after we've processed all our elements. … We end up with the result. … In the case of finding the sum … of an array of numbers for example, … we add each element to the initial value … over and over again until we find our final result. … And if we were trying to find the product … of an array of numbers, we'd multiply each element … by the initial value, and so on. …
- The goal of functional programming
- Declarative vs. imperative programming
- Ensuring immutability
- Arrow functions in ES6
- Passing functions as arguments
- Mapping, filtering, slicing, sorting, and reducing
- Advanced functional concepts, including recursion
Skill Level Intermediate
1. Introductory Functional Concepts
2. First-Class Functions
4. Advanced Functional Concepts
5. Code Conversion Challenges
Next steps1m 10s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.