The array length property
A property (no brackets) giving how many items are in an array. The last index is length - 1, an empty array has length 0, and length grows as items are added.
Understanding The array length property in ACARA Digital Technologies Years 9–10
What it does: Using names.length with no brackets gives the number of items stored in the names array. Indexes start at 0, so the last index is length - 1. scores[scores.length] is index 4, which is undefined. push adds an item, so length grows by 1. It went from 2 to 3. pop removes the last item, so length shrinks by 1. The length is now 2. JavaScript keeps length up to date for you whenever the array changes. Adding () tries to call length as a function, which causes a TypeError because length is a number.
Common mistakes: {} makes an empty object, not an array, so push() fails and items.length is undefined. An empty array is written [] and starts with length 0. The parameter is named list, but the body uses arr, so arr is not defined. The parameter must be arr to match arr.length.
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
array.lengthFill in the Blanks
Spot the Error
Student with a class code? Join your class →