Kyle walks through the solution to exercise 5. The solution is located in the file ex5-fixed.js.
(woodwind music)…- Let's take a look at this, Exercise Five.…It might be useful for me to start from the bottom.…Which is to think about…what would it look like…for me to call a custom iterator…to create a customized iterator.…It might be the case that I would have the numbers object…at Symbol dot iterator.…We know that's a function…so I can pass in some arguments to it.…
Now what arguments do I want to pass in?…I want to pass in the value of where it should start,…the increment,…and where it should end.…I could do that as three separate arguments…but we learned earlier…about object destructuring…and named arguments and things like that.…So I'm gonna use an object…and I'm gonna pass in…a start value of six,…an increment,…I'll call it step value of four,…and an end value of 30.…
So I used an object to do the named arguments.…Everybody with me so far?…So now we know that if it's called by default,…we're going to need defaults for all these,…but if it's not called by default,…it's going to allow us to customize…by specifying one or more of these arguments.…
This course was created by Frontend Masters. It was originally released on 01/10/2017. We're pleased to host this training in our library.
- The arrow function
- Arrow function variations
- Closures and explicit blocks
- Default values
- Using the gather and spread operators
- Dumping variables
- Concise properties and methods
- Symbols, iterators, and generators
- Optimizing codes for the reader
Skill Level Intermediate
1. Arrow Functions
2. Block Scope
3. Default Values and the Gather/Spread Operators
5. Template Strings
6. Symbols, Iterators, and Generators
- 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.