- script.js
JavaScript
var page = 7;
var count = 3;
muffin.print(page);
muffin.print(page);
muffin.print(page);
Result
Goalscompleted
Replace command duplication with the for
loop.
- Delete the
muffin.print
commands and replace them with the loop:for (var i = 0; i < count; i = i + 1) { }
. - Inside the loop, add the command
muffin.print(page)
. - Change the value of the variable
count
to5
and make sure that the number of printed copies has changed.
Comments