In this exercise, you must turn the mult() function into a recursive function that can work on as many arguments as necessary.
- Exercise three, let's pull up exercise three.…Do a tad bit of experimentation with our understanding…of recursion.…Exercise three.…Take mult which is already defined,…turn it in a recursive function that can work on…as many arguments as necessary.…So how is mult currently defined?…It only works with three parameters x, y, and z.…
Line seven would create a problem for us…because it's still going to return 60 instead of 360…the way we expect.…You could do this iteratively with a four loop…and if that helps you, turn it first…into an iterative solution, if that helps,…but the exercise here is to ask yourself…what is the multiplication of all these arguments?…And by the way it's going to look an awful lot…like that last slide that we just looked at.…
Author
Released
5/12/2017This 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
- Immutability
- Closure
- Recursion
- List operations
Skill Level Intermediate
Duration
Views
Related Courses
-
Learning ECMAScript 6
with Eve Porcello2h 4m Beginner -
Learning Functional Programming with JavaScript
with Shaun Wassell59m 23s Intermediate
-
1. Pure Functions
-
Course introduction9m 17s
-
Course agenda7m 29s
-
Side effects9m 40s
-
Exercise 11m 50s
-
Exercise 1: Solution, part 17m 21s
-
Exercise 1: Solution, part 27m 30s
-
-
2. Composition and Immutability
-
Manual composition4m 15s
-
Composition utility7m 31s
-
Immutability6m 40s
-
-
3. Closure and Recursion
-
Closure6m 25s
-
Exercise 21m
-
Exercise 2: Solution1m 51s
-
Recursion12m 16s
-
Recursive example3m 54s
-
Exercise 31m 4s
-
Exercise 3: Solution4m 29s
-
-
4. List Operations
-
List transformation12m 2s
-
List exclusion7m 24s
-
List composition9m 2s
-
List iteration3m 31s
-
Exercise 45m 36s
-
Exercise 4: Solution, part 16m 51s
-
Exercise 4: Solution, part 211m 52s
-
Exercise 4: Solution, part 311m 12s
-
Exercise 4: Solution, part 46m 31s
-
Wrap up5m 24s
-
- 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.
CancelTake 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.
Share this video
Embed this video
Video: Exercise 3