Below is a code for ordering a pizza. One thing I didn't clearly understand is that getSubTotal has a parameter itemCount and at the end of the line when the function getSubTotal is called the argument inside it is orderCount and not the parameter itemCount. Is it because orderCount is the argument for the itemCount?
Hope I explained my question clearly.
var orderCount = 0;
function takeOrder(topping, crustType) {
console.log('Order: ' + crustType + ' crust topped with ' + topping);
orderCount = orderCount + 1;
}
function getSubTotal(itemCount) {
return itemCount * 7.5;
}
takeOrder('bacon', 'thin');
takeOrder('pepperoni', 'regular');
takeOrder('pesto', 'thin');
console.log(getSubTotal(orderCount));
Thank you.