Returning a Value From a Function
This lesson introduces you to returning a value from a function.
We'll cover the following...
Returning Functions
The functions can return a value using the return
keyword inside the function definition. After the return statement is executed, the control gets back to the caller. A function invocation is replaced with the value that the call returns. Thus, that value can be saved in a variable.
Syntax
The function definition for returning a value from a function:
There are two ways to actually return the value.
The general ...