Join Carl Peaslee for an in-depth discussion in this video Function arguments, part of React: ES6, ES2016, and Beyond.
- [Instructor] In this video, we're going to be talking about…function arguments.…Function arguments combines some of…the functionality of the spread operator,…and also the object destructuring assignments.…Let's open up our examples directory,…and then we're going to take a look at the file here…called fuctionArgs.…I'll uncomment this.…Some of the new syntax in ES2016 allows you to use…the spread operator in the argument section of a function.…This allows you to access all of the arguments that are…passed into that function as an array.…
So here in function getEmAll, we see ...args,…and that means here when I console.log args,…I'd actually receive an array with each index representing…every single individual argument that's been passed…into getEmAll.…By specifying a default type in our argument,…that means we can avoid getting errors…if that specific argument is not passed into the function.…For instance here, on line seven, when I get some default,…I can use the equal sign in my argument to indicate…that I want my string to default to a string,…
- 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.