Interactive online courses HTML Academy
2026-03-09 10:57 Diff
  • script.js

JavaScript

var totalPages = 6; // Total number of pages for (var page = 1; page <= totalPages; page++) { muffin.print(page); }

Thanks! We’ll fix everything at once!

Result

  1. After the variable totalPages, declare a variable consumptionTotal equal to 0.
  2. After it, create a variable consumptionPerPage. It equals 70.
  3. Inside the loop, after initiating the muffin.print() command, increase the value of consumptionTotal variable by consumptionPerPage with the help of the += operator.
  4. Below, in the loop, log the consumptionTotal value in the console.