- 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
modehas the value'pageCopy'. - Inside this condition, add a loop that increases the variable
copiesfrom one tocopyCountinclusive. Value ofcopiesmust increase by one after each iteration. - Inside the loop, add the command to print the page being copied:
muffin.print(pageNumber).
Comments