A labeled box that can hold anything - swap what's inside any time you like, but the label on the box never changes.
A variable is a labeled box that stores a value so your program can remember and reuse it. console.log(...) is how JavaScript shows something on screen - it's the exact same job Python's print() does, just a different name.
let name = value;
console.log(name);let dinosaurName = "Rex";
console.log(dinosaurName);Line 1 creates a box labeled "dinosaurName" and puts the text "Rex" inside it. Line 2 asks JavaScript to show whatever is in that box right now - so "Rex" gets printed.
const favoriteGame = "Space Race";
console.log(favoriteGame);const works just like let, except the box is locked once filled - you can't put a different value in later. Use const for values that should never change, let for ones that will.
In the app this lesson continues with the animated explanation, spoken aloud, and then the practice: Create a variable called petName set to "Max", then print it with console.log. The editor runs your child’s real code and checks the result, with their coding buddy reacting to what they wrote.
Try it free