- script.js
JavaScript
var totalPages = 7;
Result
Goalscompleted
Let’s log the pages of the document in the loop.
- Under the variable declaration, add an empty loop to the code
for (;;) { }. - In the initialization part of the loop, create a counter variable:
var page = 0, - in the condition part, set the test for continuing the loop:
page < totalPages, - in the update part, increase the counter:
page = page + 1. - And in the body of the loop, add the page print command:
muffin.print(page).
Comments