Functions | Return II

I am asked to create a function called getTax, and add in a parameter orderCount. when I do

const getTax = (orderCount) => {};

It passes me to the next step. However, I am supposed to put

return getSubTotal(orderCount) * 0.06;

into the body of the function. I get an error and cannot move on. When I got the code after numerous tries, the final answer for the function had nothing in the parameter. This was the correct answer:

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

Why is it that I can only move past the first step when I enter orderCount as the parameter, but am unable to progress past the second step without deleting orderCount from the first parenthesis? I cannot for the life of me figure out what it is I am missing.

There seems to be a bug.
You can report it ro codecademy

1 Like

Hi @honduranheat,

There seemed to be differences of code between the Get Code answer versus the exercises’s instructions (report was filed a while ago but you can try to submit your own through the report button again), I suggested a workaround here and there it links towards another length reply which I stated out the inconsistencies:

Hope that helps :slight_smile:

1 Like

There seem to be two different versions of this course:

1 Like

HI @danielst.finley,

Yup, great that you notice too. I have posted a long reply about the two versions of lessons a while ago here:

The issue is not only there are two different versions, but people are getting confused with the inaccurate Get Code answer there where the Get Code answer is following another exercise (older one) instead of following the supposed lesson of getTax function taking one parameter, orderCount. If people use Get Code in that lesson, the Get Code provide no parameter in getTax function as the answer.

That is why in this lesson of what @honduranheat is asking about, the Get Code answer should be ignored. getTax should take in one parameter so that you can progress further because the continuing steps will need to verify that. Please read about my reply in the linked post I posted above, all explanations are there. :slight_smile:


Hi, @codexthon
Gratitude for taking the time and effort in putting together such comprehensive explanation! Thank you.


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