Hi guys,
I don’t understand why I’m getting 0 as the “orderCount” output when I increase the number every time the function “takeOrder” runs.
My code is here:
var orderCount = 0;
var totalPrice = 0;
function takeOrder(topping, crustType) {
console.log("Order: " + crustType + " pizza topped with " + topping);
orderCount = orderCount++;
}
function getSubTotal (itemCount) {
return itemCount * 7.5;
}
takeOrder("bacon", "thin crust");
takeOrder("pineapple", "thick crust");
takeOrder("cheese", "ultra massive crust");
console.log(getSubTotal(orderCount));
Thanks for your feedback!
Cheers, Martin