- script.js
JavaScript
var mode = 'pageCopy'; // Printing driver mode
var pageNumber = 5; // Copied page number
var copyCount = 7; // Number of copies
Result
Goalscompleted
Let’s add the copy printing mode.
- After declaring the variables, add a condition that checks that
mode
has the value'pageCopy'
. - Inside this condition, add a loop that increases the variable
copies
from one tocopyCount
inclusive. Value ofcopies
must increase by one after each iteration. - Inside the loop, add the command to print the page being copied:
muffin.print(pageNumber)
.
Comments