Learn Form Validation by Building a Calorie Counter - Step 66

Tell us what’s happening: Your calculateCalories function should reset the global error flag to false

Your code so far

function calculateCalories(e) {
e.preventDefault();
globalErrorFlag = false;
} 

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 66

Then, reset your global error flag to false .

The variable is not named globalErrorFlag scroll up and look at the variables at the top of the file. You should find one that is named something that would make sense to use for this.

4 Likes

hey I solved this I just wanted to ask how you Rember your variables like that if I did look at this post I don’t think I would have connected those dots.

If you coded it yourself you would likely remember the variable you used. Or if you forget the name you know where to look for it (and you know it exists).

In this case, unless you remember the variable name you were asked to write you have to read the code as if you didn’t write it. This is just as useful a skill, if not more at times, considering just how much code you have to read and understand that you won’t have written yourself.

1 Like