getTax Parameter

So this is a basic question but - here is part of the pizza.js lesson instructions:

“Let’s start with calculating the tax. Under the getSubTotal() function, create a function expression using the variable const named getTax. It should take one parameter, orderCount”

According to Codecademy, the correct answer is:

const getTax = () => { return getSubTotal(orderCount) * 0.06; };

With the empty parentheses. But I thought that when they say that getTax should take one parameter, you would need to declare the parameter in the parentheses when introducing the function, like below:

const getTax = (orderCount) => { return getSubTotal(orderCount) * 0.06; };

Do you not always need to declare the parameter in the parentheses if you want the function to take the parameter?


Hi @cliffgallagher,

Report was filed. However, CodeCademy is in the midst of rolling out new courses currently, I guess this change will take a while to happen (I do not speak for them). Essentially, you have quite a similar question to another user posted a while ago that I replied to. I will link down below for your reference:

It’s a rather lengthy reply, so I just link it rather than posting the same thing again.

Hope this helps. :slight_smile:

Hi @codexthon, got it, thanks!

1 Like

I noticed that the hint for this passes orderCount to getTax, but when I finally clicked “get code”, it doesn’t pass that in.

const getTotal = () => {
return getSubTotal(orderCount) + getTax(orderCount);

const getTotal = () => {
return getSubTotal(orderCount) + getTax();

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