The last step in the exercise 4 solution is to incorporate the filter() method so only odd or even values can be passed to addn().
Let's start this out with this array here,…and then let's perform the operations…like we're doing.…So right now, we have arr equals arr.map, with foo.…So all I did is split those out…so we're dealing with separate lines now.…All right, so let's add an additional step in here.…Which, before we are mapping the functions,…we want to look at the values themselves,…and filter out any of those values that are odd.…
This course was created by Frontend Masters. It was originally released on 03/08/2016. We're pleased to host this training in our library.
- Pure functions
- Manual composition
- Composition utility
- List operations
Skill Level Intermediate
1. Pure Functions
2. Composition and Immutability
3. Closure and Recursion
4. List Operations
- 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.