Join Carl Peaslee for an in-depth discussion in this video Arrow functions, part of React: ES6, ES2016, and Beyond.
- [Instructor] Arrow functions are another…notable addition that came with ES5,…and are available here in ES2016.…They are useful for two essential reasons.…The first is that they reduce boilerplate…and are more succinct, and the second…thing is that they allow us to preserve…the context of the wrapping function.…Let's look at our arrowfunction.js file…here in examples, we'll open that up.…In our index.js file in source,…we're going to import that and we're…going to call the function because…if you remember, we've made our module…into a function that we can call…so we can test the code inside of it.…
As I was saying, the arrow function,…one of its main features is that it's…more succinct, it reduces boilerplate.…Let's look at an example.…I've created a function and it's called…function withACallBack and it accepts…two arguments, options and callback…and then inside of it, it just…calls the callback on the options.…Let's see three examples where we call this function now.…Here on line nine, we call withACallBack…and we say so long as the option and then…
- Using const and let
- Importing and exporting modules
- Arrow functions
- Destructing assignments
- Arguments and template literals
- Extended parameter handling with the spread operator
- Generating custom styles
- Classes, getters and setters
Skill Level Intermediate
1. Variables and Declarations
2. Arguments and Template Literals
4. Promises and Async
- 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.