- 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, replace the initial value of the
page
variable to2
. - To make sure that everything works, let’s change the number of pages to odd
9
.
Comments