Loading your library…
JavaScript workshop · About 10 minutes
Follow one small program from the first line to a working scoreboard. Take your time; you can correct every mistake.
Step 1 of 5 · Meet the two parts of the program.
let score = 0 stores a number that can change. The function addPoints receives a number named points.
score += points adds those points to the existing score. Calling the function twice keeps both additions. Finally, console.log prints the result.
Prerequisite: you can type letters, numbers and basic symbols. We will explain the JavaScript as we go.