Keep the lesson open on your other screen. Your edits stay in this workspace, separate from the practice activity. Sign in to save and reload a private account draft across devices, or share a snapshot when you need help.
Pause whenever you want to try a change. You can return to the lesson at any time.
You are signed in, but video access needs attention. Check your account access. Your saved work is kept.
Video walkthroughs are included with an active Code Zone membership. The written lesson and practice are free.
Video settings & progress
Your lesson progress
Reading & walkthrough: not started
Empty: not started. Yellow: in progress. Green: complete. Marking the whole activity complete does not replace your test results. These circles save in this browser for this pilot.
Start the video to enable typing controls.
YOUR TURN
Code variables with Rob: code-along
Change a value, run your code, and check your prediction. Follow the video, write the program yourself and run it to inspect the output. This workspace is not graded. Save a draft or share a help snapshot when needed.
Load an example, edit it and run it. Word wrap is enabled.
Your check results
Work in VS Code instead
Copy the starter into a file named practice.js in VS Code. If Node.js is installed, open the terminal in that folder and run node practice.js. Compare the output with the task above. Automated challenge checks are available in the browser editor.
Code example
example.jsjavascript · example
// Code variables with Rob// Write your code alongside the video.
Lesson reference
Examples load into this same code-along only after you confirm replacing your code.
Choose const and let deliberately
Work through 4 focused steps. Read the explanation, type each requested change and check it before moving on. Your own code carries forward.
The mini-lesson opens in a new tab. Your own code carries forward; each step has a focused check and an optional hint.
When a value changes, work out the expression on the right of = first. Then assign that result to the name on the left.
The + operator adds numbers here. The starting value is 2, so adding 1 and assigning the result makes completedLessons hold 3.
Use the current value to calculate the next one
example.jsjavascript · example
let completedLessons = 2;completedLessons = completedLessons + 1;console.log(completedLessons);
Predict, run, compare
Before running an example, say what you think it will print. Run it, compare the result, and change one value to test your understanding.
In the challenge, subtraction uses the - operator. A used ticket should reduce the remaining count. Keep the calculation connected to the named values so it also makes sense when the starting numbers change.