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:
Create a free account to access the full course.
Continue your learning journey with a 14-day free trial.
By signing up, you agree to Educative's Terms of Service and Privacy Policy