Using a function that sums three numbers as an example, Kyle demonstrates how to take a non-recursive operation and add recursion. He also shows a cleaner version of the recursive function which utilizes ES6 syntax.
That sort of thing; that's kind of ugly.…But, I promise on the very next slide…I'm about to show you a prettier way of expressing it,…now that we have ES6.…But, importantly here, we have a base case.…Our if statement is a base case,…in which case we return an immediate operation…that doesn't need to call any other function.…And then we have a recursive call.…So we have our two characteristics…that make this a recursive solution.…And you'll notice that what I'm saying here…is that the summation of any list of numbers…is the same thing as the first number plus…
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?
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.