Returning a Value From a Function

This lesson introduces you to returning a value from a function.

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.

By signing up, you agree to Educative's Terms of Service and Privacy Policy