Functions
In this lesson, we'll get to know JavaScript functions. Let's begin!
As you learned in the previous chapter, functions are very important concepts in JavaScript.
In this section, you’ll dive deeper into the implementation of functions and get acquainted with many exciting features that make JavaScript functions powerful.
Function return values
Functions may retrieve results.
- You can use the
returnstatement to pass back a result. - If you specify
returnwith no value, the function will immediately return without a value. - If you utilize the result of a function that does not return a value, be prepared that you could get
undefined.
The Listing below demonstrates this behavior:
Listing: Using return in various ways in a function
...Ask