Intro to Javascript functions 6/7

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

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
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));

<do not remove the three backticks above>

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

1 Like

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%)?

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

2 Likes

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