Why wont code work when in function exercise?

I did everything i lesson asked, passed all steps and exercises, yet it doesnt run. I’m confused as to what happened here.

in this exercise, the instructions state:

Inside the takeOrder() function, set orderCount equal to orderCount plus 1, so that each time the takeOrder() function runs, 1 is added to the orderCount

you didn’t do this correctly, you didn’t increase orderCount inside the takeOrder function, you increased orderCount in the parameters of takeOrder function


awesome! thank you for pointing out that simple mistake. now any reason as to why that would still let me pass that exercise?

It shouldn’t let you pass. But there are two possibilities,once you completed an exercise (or even a step of an exercise), if you run the code again, the code isn’t validated again (unless you reset the exercise)

once you move on to a next exercise, old code won’t be re-validated.

Codecademy only validates once that you did the instructions correctly, any changes made after will not be reflected in instruction steps checkboxes (with the exception of reset)

so it could be you made changes after getting passed the step


hmm, i know i misunderstood the hint box and wrote what i had in the parameter where i had it. and once i wrote it in there it said I passed, and it continued with this error all the way until the end. Idk, maybe something to look into. What you see if what passed without ever changing anything if the steps didnt ask me to.

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