Functions- Returns

When a function is called, the computer will run through the function’s code and evaluate the result of calling the function. By default that result is undefined.To pass back information from the function call, we use a return statement.To create a return statement, we use the return keyword followed by the value that we wish to return. When a return statement is used in a function body, the execution of the function is stopped and the code that follows it will not be executed. In the following video, we will practice using the return keyword to enable functions to produce an output that can then be stored in a variable for use somewhere else in our code.


  1. Click the play button to watch the video lesson.
  2. Watch the lesson as many times as needed.
  3. Code along with the instructor using the integrated code editor in the center of your screen.
  4. You can use the Run button beneath the code editor to test your code.
  5. Output from the code that you have written will appear in the panel on the right side of your screen.

If you get stuck or need assistance, you can click the button below to connect with a tutor. 

For additional questions or technical support, email