I got stuck at functions in 5th lesson return


#1


https://www.codecademy.com/en/courses/learn-javascript/lessons/functions/exercises/return


Did you declare a variable named orderCount set equal to the number 0?


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));


#2

Works fine in CodePen


#3

but why still am getting same error, i don't know and i got the same result as you got . thanks for helping me.


#4

i have the same problem


#5

Try using different browser. People usually have problems with Firefox.


#6

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