← ACARA Digital Technologies Years 7–8

Running a JavaScript program and viewing the console

The panel beside the editor where your program's output appears after you press Run. Each console.log shows in order, and you run the program again after every change.

Understanding Running a JavaScript program and viewing the console in ACARA Digital Technologies Years 7–8

What it does: This line is typed in the editor. After you press Run, the console shows Score: 10. Code only produces output after you run it. Typing it is not enough. Output appears in the same order as the code runs, from top to bottom. JavaScript can run in Node.js or in a browser. Both have a console that shows console.log output. You write code in the editor and read the results in the console. The console only updates when you press Run. Run again to see the new output. Every console.log that runs adds its own line to the console, in order.

Common mistakes: The text "End is missing its closing quote, so the program will not run and the console shows an error instead of the output. It should be console.log("End");. consol is misspelled, so JavaScript cannot find it and the console shows an error. It should be console.log("Done");.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

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 522–560) 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.

Learning
Duo
Where does the output of console.log() appear when you run your program?
In the editor beside your codeIn the console panel
Matches
Change console.log("Hi"); to console.log("Hello"); in the editor, but do not press Run. The console still shows Hi.
↓
The program was not run again after the change. The console only updates when you press Run, so run it again to see Hello.
Applying
Meanings
Term
console
Meaning
The panel beside the editor where your program's output appears after you press Run. Each console.log shows in order, and you run the program again after every change.
Practice
console.log("Program started");
Testing
Gaps
.log("Hello, world!");
Check Answer
Spots
2console.log("Middle");
3console.log("End);

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Jellyfish' badge — Flow Controller, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Where does the output of console.log() appear when you run your program?
A. In the editor beside your code
B. In the console panel ✓
The editor is where you type code. The console is the panel where output shows after you press Run.
2. You type console.log("Hi"); in the editor but have not pressed Run yet. What shows in the console?
A. Nothing yet, the program has not run ✓
B. Hi
Code only produces output after you run it. Typing it is not enough.
3. You change "Hi" to "Hello" in your code. What should you do to see the new output?
A. Press Run again ✓
B. Wait for the console to update by itself
The console shows the result of the last run. Run the program again after every change.
4. A program has console.log("A"); then console.log("B"); then console.log("C"); What does the console show?
A. A, then B, then C, one per line ✓
B. C, then B, then A
Output appears in the same order as the code runs, from top to bottom.
5. Which statement about the console is true?
A. It only exists inside the Node.js program
B. It can be the console panel in Cloodit, Node.js or a browser ✓
JavaScript can run in Node.js or in a browser. Both have a console that shows console.log output.

Match the Pairs

console.log("Hi"); → Sends the text Hi to the console panel, where it appears after you press Run
console.log(1); console.log(2); console.log(3); → Shows 1, then 2, then 3 in the console, one line each, in the same order as the code
You write your program in the editor panel, then press Run to see the output in the console → console.log("Score: 10");
After you change your code in the editor, run it again so the console shows the new output → console.log("Hello, Sam!");
Change console.log("Hi"); to console.log("Hello"); in the editor, but do not press Run. The console still shows Hi. → The program was not run again after the change. The console only updates when you press Run, so run it again to see Hello.
Type console.log("Hi"); into the console panel and expect it to be part of your program. → Code belongs in the editor, not the console. The console only displays the output after you press Run.

Key Term

console
The panel beside the editor where your program's output appears after you press Run. Each console.log shows in order, and you run the program again after every change.

Fill in the Blanks

1. console.log("Hello, world!");
Hint: Type the name of the object whose log method sends text to the output panel beside the editor.
2. console.log("Program started");
Hint: Type the method name that prints a message in the console when you press Run.
3. let score = 5; score += 1; console.log(score);
Hint: Type the variable name whose current value should appear in the console.
4. const player = "Mia"; console.log(player);
Hint: Type the keyword that declares a value that will not change before the console prints it.
5. // Output appears in the console console.log("Hi");
Hint: Type the symbol that starts a single-line comment, which Run skips and does not show in the console.

Spot the Error

Question 1
A console.log("Start");
B console.log("Middle");
C console.log("End);
Line C — The text "End is missing its closing quote, so the program will not run and the console shows an error instead of the output. It should be console.log("End");
Question 2
A let name = "Mia";
B console.log("Hello");
C console.log(name);
D consol.log("Done");
Line D — consol is misspelled, so JavaScript cannot find it and the console shows an error. It should be console.log("Done");
Question 3
A Console.log("Ready");
B console.log("Set");
C console.log("Go");
Line A — JavaScript is case sensitive. Console with a capital C is not the same as console, so nothing is printed. It should be console.log("Ready");
Question 4
A let score = 10;
B console.log(score;
C score = score + 5;
D console.log(score);
Line B — The closing bracket is missing, so the program will not run. It should be console.log(score);
Question 5
A let x = 4;
B let y = 6;
C console.log(x + z);
Line C — The variable z was never created, so running the program gives a ReferenceError in the console. It should be console.log(x + y); to show 10.

Student with a class code? Join your class →