Arrow functions make using promises a little easier syntactically because the abbreviated syntax makes for cleaner code. Kyle, however, argues that anonymous functions within promises can make debugging more difficult. Kyle then spends a few minutes talking through a use case for the arrow function that greatly benefits developers.
(asian-style music)…- I get people all the time saying, oh but.…I write promises, and man, I hate doing stuff like this.…I hate doing, you know,…I hate having to write out...…I don't want to have to write that, that's way too long.…I want to just write p.then.…
Okay?…So this arrow function is going to show up as an…anonymous function right there in your stack trace.…So even in these cases, these real simple cases,…these little one liner things where you think…it's a clear win in readability,…the cost comes on the backend,…whenever something breaks, and now you have a worse…stack trace to deal with,…a stack trace that doesn't give you any help…
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.