Intro to Javascript functions 6/7


#1

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


I feel like i'm doing exactly what it asks but it keeps giving me an error message.


var orderCount = 0;

function takeOrder(topping, crustType){
orderCount+=1;
 
  
  console.log('Order: pizza '+ crustType + ' topped with ' + topping);
}

function getSubTotal(itemCount){
  return itemCount* 7.5;
  
}

function getTax(){
  return getSubTotal * (0.06);
}



takeOrder("sardines", "pan style");
takeOrder("bacon", "deep dish");
takeOrder("pepperoni", "thin crust");

console.log(getSubTotal(orderCount));


#2

Aren't you supposed to get the whole total after tax in this lesson? Not just the subtotal?


#3

In the end yes. But i'm stuck on second part of the assignment. I keep getting this error message:
Did you pass in orderCount to the getSubtotal function inside the getTax function's block?
Did you multiply the subtotal by 0.06 (or 6%)?


#4

You need to give the itemcount parameter for your getSubTotal() function inside your getTax() function.


#5

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