…We've been passing a specific number of elements to functions, and…that's okay, but oftentimes, you either don't know how many elements…you'll be needing to pass to a function or you want…your function to be able to accept any number of elements.…For that we can use a special…object available to functions called the arguments parameter.…In short, the job of the arguments parameter is to hold…a list of all the elements passed as arguments to the function.…Now we say that the arguments…parameter is an array-like object, because it looks like an array and…can do some of the things that we can do to arrays.…
So for example, we can call the arguments with an…index and get, say, the second argument passed to the function.…Now we can also get the arguments' length, the property that…gives us the amount of elements that were passed to the function.…Because we have these two properties, we can…loop through the arrays easily with a for loop.…Because they're…not arrays but an object that happens to have some list-like…
- What are functions?
- Using functions as objects
- Understanding call-and-apply invocation
- Using the arguments parameter
- Returning values
- Understanding hosting and variable scope
- Chaining module method calls
Skill Level Intermediate
1. Getting Started
2. Function Invocation
3. Using Functions
Next steps1m 28s
- 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.