← JavaScript

Functions – Parameters

A named placeholder inside a function's parentheses that receives an input value when called.

Understanding Functions – Parameters in JavaScript

What it does: The parameter name stores whatever value is passed to it. A comma divides one parameter from the next. Parameters act as inputs the function can use. Each parameter in the list is separated by a comma. You can use the parameter name anywhere inside the function body. Without a comma, this isn't valid parameter syntax. JavaScript treats name and Name as two different identifiers. Functions can declare as many comma-separated parameters as needed.

Common mistakes: 'function' must be lowercase - a capital F causes an error. Multiple parameters need a comma between them: (a, b).

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
Do function parameters let you pass values into a function?
YesNo
Matches
function add(a b) { ... }
↓
Wrong - multiple parameters need a comma between them
Applying
Meanings
Term
parameter
Meaning
A named placeholder inside a function's parentheses that receives an input value when called.
Practice
function greet(name) {
Testing
Gaps
function greet() {
Check Answer
Spots
1Function greet(name) {
2console.log(name);

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

The 'Owl' badge — Wise Coder, 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. Do function parameters let you pass values into a function?
A. Yes ✓
B. No
Parameters act as inputs the function can use.
2. Are multiple parameters separated by commas?
A. No
B. Yes ✓
Each parameter in the list is separated by a comma.
3. Is a parameter treated as a variable inside the function?
A. Yes ✓
B. No
You can use the parameter name anywhere inside the function body.
4. Is (a b) valid syntax for declaring two parameters?
A. No ✓
B. Yes
Without a comma, this isn't valid parameter syntax.
5. Must parameters be listed inside the function's parentheses?
A. No
B. Yes ✓
Parameters always go inside the ( ) after the function name.

Match the Pairs

function greet(name) { ... } → Declares a function that accepts a name parameter
function add(a, b) { ... } → Declares a function that accepts two parameters, a and b
Holds the value passed in when a function is called → name
Separates multiple parameters in a function declaration → ,
function add(a b) { ... } → Wrong - multiple parameters need a comma between them
Function greet(name) { ... } → Wrong - 'function' must be lowercase

Key Term

parameter
A named placeholder inside a function's parentheses that receives an input value when called.

Fill in the Blanks

1. function greet(name) {
Hint: Type the parameter name declared inside the parentheses.
2. function add(a, b) {
Hint: Type the second parameter name.
3. function multiply(x, y) {
Hint: Type the second parameter name.
4. console.log(a + b);
Hint: Type the operator used to add the two parameters.
5. function introduce(name, age) {
Hint: Type the first parameter name.

Spot the Error

Question 1
A Function greet(name) {
B console.log(name);
C }
Line A — 'function' must be lowercase - a capital F causes an error.
Question 2
A function add(a b) {
B console.log(a + b);
C }
Line A — Multiple parameters need a comma between them: (a, b).
Question 3
A function sub(a, b) {
B console.log(a - b)
C }
Line B — This line is missing a semicolon, but that's not required in JS.
Question 4
A function mult(x, y) {
B console.log(x * y)
C }
Line B — This line is missing a semicolon, but that's not required in JS.
Question 5
A function greet(name) {
B console.log(name);
C ]
Line C — The block must close with }, not ].

Student with a class code? Join your class →