Functions with several parameters
Separate several parameters with commas. A call like add(2, 3) must give one argument for each, in the same order. A missing argument becomes undefined.
Understanding Functions with several parameters in ACARA Digital Technologies Years 7–8
What it does: The arguments are in the wrong order, so name gets 12 and age gets "Ava". The call should be say("Ava", 12). Only one argument was given, so a is 5 and b has no value. It becomes undefined, and 5 + undefined gives NaN. Several parameters are separated by commas. Without the comma, JavaScript gives a syntax error. Arguments match parameters in order: the first argument goes to a and the second goes to b. Swapped arguments change the answer. subtract(4, 10) gives -6 because a is 4 and b is 10. The comma between a and b shows the function takes two inputs, so each call needs two arguments.
Common mistakes: The function only has the parameters w and h, so x is not defined. It should be return w * h;. Several parameters must be separated by a comma. It should be function add(a, b) {.
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 611–623) and word search (Modules 583–613) and word search (Modules 611–634).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
function add(a, b) {Fill in the Blanks
Spot the Error
Student with a class code? Join your class →