- script.js
JavaScript
var totalPages = 12;
for (var page = 1; page <= totalPages; page += 2) {
muffin.print(page);
}
Result
Goalscompleted
Now let’s log only even pages.
- To do this, set the initial value of
pageto2. - To check that everything works, change the page count to an odd number:
9.
Comments