0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<ul><li>script.js</li>
1
<ul><li>script.js</li>
2
</ul><p>JavaScript</p>
2
</ul><p>JavaScript</p>
3
<p>var diceNumber = 2; var firstCat = { name: 'Muffin', points: 0 }; var secondCat = { name: 'Rudolph', points: 0 }; var cats = [firstCat, secondCat]; var runGame = function (quantity, players) { for (var i = 0; i < players.length; i++) { console.log(players[i]); } }; runGame(diceNumber, cats);</p>
3
<p>var diceNumber = 2; var firstCat = { name: 'Muffin', points: 0 }; var secondCat = { name: 'Rudolph', points: 0 }; var cats = [firstCat, secondCat]; var runGame = function (quantity, players) { for (var i = 0; i < players.length; i++) { console.log(players[i]); } }; runGame(diceNumber, cats);</p>
4
<p>Thanks! We’ll fix everything at once!</p>
4
<p>Thanks! We’ll fix everything at once!</p>
5
<h2>Result</h2>
5
<h2>Result</h2>
6
<ol><li>Inside the loop in the body of the function, remove element console log.</li>
6
<ol><li>Inside the loop in the body of the function, remove element console log.</li>
7
<li>Within the loop, declare variable throwResult, which contains the result of one roll muffin.throwDice(quantity, quantity * 6);.</li>
7
<li>Within the loop, declare variable throwResult, which contains the result of one roll muffin.throwDice(quantity, quantity * 6);.</li>
8
<li>Increase the number of roll points for the current player players[i].points += throwResult;.</li>
8
<li>Increase the number of roll points for the current player players[i].points += throwResult;.</li>
9
<li>Log in the console the player’s name and the number of their game points players[i].name + ' rolled ' + players[i].points.</li>
9
<li>Log in the console the player’s name and the number of their game points players[i].name + ' rolled ' + players[i].points.</li>
10
</ol>
10
</ol>