- script.js
JavaScript
var totalPages = 5;
for (var page = 1; page <= totalPages; page = page + 1) {
muffin.print(page);
}
Result
Goalscompleted
Let’s print the pages in reverse order.
- Change the initial value of
page
from one tototalPages
. - The loop must be executed while
page
is above zero. - After each iteration
page
should decrease by one.
Comments