6.returnII pizza total


#1

https://www.codecademy.com/courses/learn-javascript/lessons/functions/exercises/return-ii?action=lesson_resume

I have achieved the total after tax that I was supposed to but I do not get the pass, what am I doing wrong here?

var orderCount=0;
function getSubTotal(itemCount){
  return itemCount * 7.5;
}
function takeOrder(topping, crustType) {
  console.log('Order: ' + crustType +' pizza topped with ' + topping);
  orderCount = orderCount+1;
}
function getTax(){
  return getSubTotal(orderCount) * 0.06;
}
function getTotal(){
  return getSubTotal(orderCount) + getTax();
}
takeOrder('eyes', 'hand');
takeOrder('pepper', 'brick');
takeOrder('lamb', 'cardboard');
console.log(getSubTotal(orderCount));
console.log(getTotal(orderCount));

#2

console.log(getTotal(orderCount));

when should you pass an argument?

getTotal function has no parameter so we don't need any argument for it.


#3

Brilliant! thank you. That makes a lot of sense now that I think of it


#4

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