Why const before let
const means **constant: once you put a value in, you can't change it. That's a feature*: it lets your reader (and the engine) know the value won't move, so you can reason about it more easily.
const highScoreGoal = 1000; // never changes -> const
let highScore = 0; // grows over time -> let
Beginners reach for let too much. If you're sure a value never changes, a name, a color, a config number, use const. It catches bugs: trying to reassign a const throws an error instead of silently corrupting data.
Naming matters more than anything
Good names are the most important skill in programming. A variable name should tell you what's inside it.
let score = 0; // good - you know what this is
let x = 0; // confusing - x could be anything
Conventions we follow throughout: lowercase, words joined by underscores (highScore, runSpeed); booleans start with is / has / can (isGameOver); and names are case-sensitive.
This exact pair appears in the real game: the game's entry file reads from a centralCONFIGobject of values likeRUN_SPEEDthat areconstbecause they never change mid-run.