Just a quick question — any answer would really help, a couple sentences is enough.
Does anyone know why you have to have something in the getSubTotal function but not in the getTax function??
This is the specific code:
const getTax = () => {
return getSubTotal(orderCount) * 0.06;
}
const getTotal = () => {
return getSubTotal(orderCount) + getTax();
Full exercise:
let orderCount = 0;
const takeOrder = (topping, crustType) => {
orderCount++;
console.log('Order: ’ + crustType + ’ pizza topped with ’ + topping);
};
takeOrder(‘mushroom’, ‘thin crust’);
takeOrder(‘spinach’, ‘whole wheat’);
takeOrder(‘pepperoni’, ‘brooklyn style’);
const getSubTotal = (itemCount) => {
return itemCount * 7.5;
};
console.log(getSubTotal(orderCount));
const getTax = () => {
return getSubTotal(orderCount) * 0.06;
}
const getTotal = () => {
return getSubTotal(orderCount) + getTax();
}
console.log(getTotal())
<do not remove the three backticks above>