- script.js
JavaScript
var score = 0;
var total = 0;
Result
GoalsCompleted 0 out of 3
Let’s add a loop, record hits in it and log them in the console.
- Add variable
victoryPoints
, which will store100
, the number of points needed to win. - Replace the loop stop condition to get the required number of points
total < victoryPoints
. - In the loop, log in the console the result of the shot from the variable
score
.
Comments