RETURN order count (lesson 5)

I don’t understand why it doesn’t count out that I ordered 3 pizzas? getSubTotal shows 0 not 22.5

let orderCount = 0;
const takeOrder = (topping, crustType) => {
console.log(Order: + crustType + pizza topped with + topping);
orderCount = orderCount++;

takeOrder(“cheese”, “thin crust”);
takeOrder(“mushrooms”, “medium crust”);
takeOrder(“onion”, “strong crust”);

const getSubTotal = (itemCount) => {
return itemCount * 7.5;


orderCount++ is a shorthand for orderCount = orderCount + 1, so what you wrote here:

orderCount = orderCount++;

if we remove the short hand we get:

ordercount = orderCount = orderCount + 1

that doesn’t look entirely right


It’s easy to see why OP (and myself) were confused. I originally did it correctly, but the HINT for that question tells you to write the wrong thing: 52


Same here, this hint should be changed!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.