← JavaScript

Functions – Return Values

Sends a value back out of a function and ends its execution at that point.

Understanding Functions – Return Values in JavaScript

What it does: return is exactly the keyword that does this. This multiplies n by itself and returns the result. return hands the value back to wherever the function was called. Once return runs, no more code in the function executes. let total = add(2, 3) stores whatever add() returns. JavaScript is case-sensitive, so 'return' must be lowercase. The correct spelling is 'return', not 'retrun'. You need to log the returned value explicitly to see it.

Common mistakes: 'return' must be lowercase - a capital R causes an error. 'return' is misspelled as 'retrun'.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 31–40) and word search (Modules 21–52).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Does return send a value back out of a function?
YesNo
Matches
Retrun a + b;
↓
Wrong - 'return' is misspelled
Applying
Meanings
Term
return
Meaning
Sends a value back out of a function and ends its execution at that point.
Practice
function add(a, b) {
Testing
Gaps
a + b;
Check Answer
Spots
1function add(a, b) {
2Return a + b;

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Giant Isopod' badge — Patient Builder, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Does return send a value back out of a function?
A. Yes ✓
B. No
return hands the value back to wherever the function was called.
2. Does return end the function's execution at that point?
A. Yes ✓
B. No
Once return runs, no more code in the function executes.
3. Can a returned value be stored in a variable?
A. Yes ✓
B. No
let total = add(2, 3) stores whatever add() returns.
4. Must 'return' be written in lowercase?
A. No
B. Yes ✓
JavaScript is case-sensitive, so 'return' must be lowercase.
5. Is 'retrun' a valid spelling of the keyword?
A. Yes
B. No ✓
The correct spelling is 'return', not 'retrun'.

Match the Pairs

return a + b; → Sends the sum of a and b back out of the function
let total = add(2, 3); → Stores the value returned by add() in total
Ends a function's execution and sends back a value → return
Sends back the square of a number → return n * n;
Retrun a + b; → Wrong - 'return' is misspelled
Return a - b; → Wrong - 'return' must be lowercase

Key Term

return
Sends a value back out of a function and ends its execution at that point.

Fill in the Blanks

1. return a + b;
Hint: Type the keyword that sends a value back from the function.
2. let total = add(2, 3);
Hint: Type the symbol used to assign the returned value to total.
3. return x * y;
Hint: Type the keyword that sends a value back from the function.
4. function square(n) { return n * n; }
Hint: Type the keyword that sends a value back from the function.
5. let result = square(4);
Hint: Type the symbol used to assign the returned value to result.

Spot the Error

Question 1
A function add(a, b) {
B Return a + b;
C }
Line B — 'return' must be lowercase - a capital R causes an error.
Question 2
A function sub(a, b) {
B retrun a - b;
C }
Line B — 'return' is misspelled as 'retrun'.
Question 3
A console.log("mult");
B function mult(x, y) {
C return x * y
D }
Line C — This line is missing a semicolon, but that's not required in JS.
Question 4
A function square(n) {
B return n * n;
C ]
Line C — The block must close with }, not ].
Question 5
A function greet() {
B return "Hi";
C }
D let msg = greet()
Line D — This line is missing a semicolon, but that's not required in JS.

Student with a class code? Join your class →