Visual blocks to JavaScript: say, ask and variables
Blocks have typed JavaScript equivalents: a say block becomes console.log, an ask block becomes prompt, and a set variable block becomes let (or an assignment with =).
Understanding Visual blocks to JavaScript: say, ask and variables in ACARA Digital Technologies Years 7–8
What it does: Set variable blocks create a variable and give it a value. In JavaScript, let creates the variable and = stores the value. The variable already exists, so you only reassign it with =. Writing let again would try to declare it a second time. A say block shows a message, so it becomes console.log. prompt is for asking the user a question. The answer from prompt() is stored by putting it on the right of an = sign, with the variable name on the left. JavaScript has no built-in say(). It would cause a ReferenceError, so use console.log("Hello!"); instead.
Common mistakes: say is a block name, not a JavaScript function. An ask block becomes prompt, so the line should be let name = prompt("Name?");. set is the word on the block, not JavaScript. A set variable block becomes let, so the line should be let score = 0;.
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 562–580) and word search (Modules 522–580).
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
console.log, prompt, letFill in the Blanks
Spot the Error
Student with a class code? Join your class →