4/16 Just curious why quantity is NOT needed as a switch parameter like item


#1

scan: function(item, quantity) {
switch (item) {
case "eggs": this.add(0.98 * quantity); break;
case "milk": this.add(1.23 * quantity); break;
case "magazine": this.add(4.99 * quantity); break;
case "chocolate": this.add(0.45 * quantity); break;
}
}


#2

A counter-question...
how would you have included the quantity into the switch ???