Removing items with pop, shift and splice
Array methods that remove items and change the original array: pop removes the last item, shift removes the first, splice(index, count) removes count items starting at index.
Understanding Removing items with pop, shift and splice in ACARA Digital Technologies Years 9–10
What it does: splice(index, count) starts at index 1 and removes 2 items, changing the original array. pop() returns the removed item, so it can be stored in a variable while the array loses its last item. shift() removes the FIRST item, so 1 is removed and a becomes [2, 3]. shift() removes from the start of the array. pop() removes from the end.
Common mistakes: pop is a method, so it needs parentheses to run. Without them the line does nothing and no item is removed. It should be stack.pop();. length is a property, not a method, so it has no parentheses. It should be line.length. After shift and pop, 2 items remain.
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 710–727) 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
pop(), shift(), splice()Fill in the Blanks
Spot the Error
Student with a class code? Join your class →