A method inside an object literal
A method is a function stored as an object property. Write it inside the object, then call it with a dot and brackets: person.greet().
Understanding A method inside an object literal in ACARA Digital Technologies Years 9–10
What it does: jump() { ... } sits inside the object literal braces, so it is a method of player. A method needs brackets after its name, like greet(), before the curly braces that hold its code. Brackets run the method. Without them you only get the function itself and nothing happens. Write the object first, then a dot, then the method name: object.method(). The method uses return, so calling cat.speak() gives back the string 'Meow'. A method is called on its object with a dot, so use car.start().
Common mistakes: A method needs brackets after its name, just like a function. It should be bark() { return "Woof"; }. Inside a method, properties of the object must be reached with this. Plain word does not exist, so it should be this.word.
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 728–742) and word search (Modules 710–742).
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
greet() { ... }Fill in the Blanks
Spot the Error
Student with a class code? Join your class →