…We've seen all the major components of functions…in action, including a special statement called return.…So let's go ahead and dig deeper and see what the statement is really doing.…Now whenever you invoke a function, it's like generating an equation.…And equation usually have results.…So we call these statements, expressions.…Because the job of the return statement, is to express…the result of the operation we perform in our function.…So right here in this plus…function, the job is to return the result.…Now the return statement is kind of optional.…
If you don't include it in your code, the function will still return something.…It'll just be the value undefined.…The return statement is only available inside the function body.…So you can't use it anywhere else.…The return statement can be used to send something back to the caller.…So you can assign it to a variable. And it'll place a value…in the variable when the function returns.…Return statements are usually the last statement in a function.…But it doesn't have to be.…
- 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.