In Kyle’s opinion, one of the drawbacks to the arrow function is the many variations. Arrow functions can be written with or without parentheses, curly braces, and the return keyword. Kyle walks through a number of these variations and explains why he believes they cause added confusion.
- I wanna talk about various variations.…We've already seen that if you want to make yourself…an empty function, or an empty parameter list,…you're gonna have to use some sort of placeholder.…Typically somebody will use something like the…open-closed parentheses like we see here,…you all so might see people just put in…a placeholder variable,…now I really hate that people use the underscore…as that placeholder variable,…they also like to do it without any spaces,…to suggest the idea that this is a variable I don't…care about, so, I'll just use this placeholder underscore…variable.…
Some people like to use x as their placeholder variable.…X is definitely better than the underscore.…That's especially true if you're working with…the underscore library.…OK, if you're working with an underscore or low-dash,…please, please, don't use underscore…as your placeholder variable name.…Unless you're trying to confuse people.…Unless you're trying to create visual hiccups.…If your goal, like mine, is to create more readable code,…
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.