Calling a function
Calling a function: write its name followed by brackets, like sayHello(), to run its code. You can call it as many times as you like. Without the brackets, it does not run.
Understanding Calling a function in ACARA Digital Technologies Years 7–8
What it does: Each call runs the function's code again, so writing the call two times runs it two times. Here the function is declared first, and then it is called with brackets so it runs and prints Hi! Calling sayHello() inside the loop runs it on every repeat. Without the brackets, nothing happens. Brackets are what trigger the call. Without the brackets, the name only refers to the function. The brackets are what run it.
Common mistakes: Line 3 has no brackets, so the function is not called and nothing prints. It should be sayHello(); and it works even before the declaration. The function name is spelled wrongly on line 1, so JavaScript can't find it (ReferenceError). It should be sayHello();.
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 599–610) and word search (Modules 583–613).
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
functionName()Fill in the Blanks
Spot the Error
Student with a class code? Join your class →