A default value could be in the form of a function call. This would be a lazy expression, because the function would not be called until it’s needed. Kyle talks through a couple scenarios where using a function as a default value would be useful. He also demonstrates how scope works with lazy expressions.
And if there was a function bar() here…that said console.log()…and put a little exclamation mark.…So the question is, in this particular program…with no executions,…how many times do you think bar has been called?…- [Student] None until you call foo.…- There's only two rational answers here:…either zero or one.…
So, how many of you would vote for zero?…It's not been called at all.…How many of you vote for one?…It's called once.…How about online?…Let's take that poll, I know we have to wait 15 seconds.…Let's take the poll online.…Raise your hand if you vote for it's been called once…
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.