Passing a function as an argument (callback)
A function passed as an argument, without brackets, to another function that calls it later. Examples: nums.forEach(show) or nums.map(n => n * 2).
Understanding Passing a function as an argument (callback) in ACARA Digital Technologies Years 9–10
What it does: isPass has no brackets, so the function itself is passed to filter, which calls it on each item. You pass double as a callback, and map calls it once for every item in the array. The arrow function n => n * 2 is the callback. Adding brackets after 2 breaks the expression because a number is not a function.
Common mistakes: Brackets after show call the function straight away with no argument. forEach needs the function itself, so write nums.forEach(show);. An arrow function uses => and not ->. The callback should be n => n * 2.
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 681–707) and word search (Modules 629–707).
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
callbackFill in the Blanks
Spot the Error
Student with a class code? Join your class →