- script.js
JavaScript
var diceNumber = 2;
Result
GoalsCompleted 0 out of 5
- At the beginning of the code, in front of the player objects, create an object
gameRules
with propertiesdiceNumber: 2
andmaxAttempts: 3
. - In
runGame
function declaration, rename parameterquantity
inrules
. - In
runGame
function call, replace argumentdiceNumber
withgameRules
. - In the body of the
runGame
function, replace the reference to parameterquantity
with accessing propertydiceNumber
of parameterrules
. - Delete the
diceNumber
variable.
Comments