Visual if and if-else blocks to JavaScript
A visual if-else block becomes if/else code. The hexagon condition goes in brackets as a comparison, and the steps from each part of the block go inside curly braces.
Understanding Visual if and if-else blocks to JavaScript in ACARA Digital Technologies Years 7–8
What it does: Putting another if-else block inside the else slot is written in JavaScript as else if, which checks a second condition only when the first is false. The visual not block turns into ! and the or block turns into ||. The condition is true if it is not raining or you have a coat. The visual = block asks a question, so it becomes === in JavaScript. A single = would assign a value instead of comparing. Each side of || needs its own full comparison. Writing just 'Sun' on its own is always treated as true, so the check does not work.
Common mistakes: The hexagon condition must go inside brackets in JavaScript. It should be: if (score >= 50) {. A single = assigns a value. The = block in a visual condition becomes === when comparing. It should be: if (colour === "red") {.
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 583–598) 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
if (score >= 50) { } else { }Fill in the Blanks
Spot the Error
Student with a class code? Join your class →