Java Script Functions 6/7


Java Script Functions 6/7

I dont know hat i have done wrong and it keeps asking if i put 'getTotal() 'in console.log

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

function getTax(orderCount) { 
  return( getSubTotal(orderCount)* 0.06);
function getTotal(){
  return getSubTotal(orderCount)+getTax();

takeOrder('bacon', 'thin');
takeOrder('pepperoni', 'regular');
takeOrder('pesto', 'thin');

console.log(getSubTotal(orderCount ));
console.log ('Total Price is'+getTotal(orderCount));


If they ask to print the result of calling that function, then they might mean to print only the result of calling that function, without prefixing it with another string


Do you mean I should erase 'total Price is'?


change total is to just console.log(getTotal());


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