Learn-form-validation-by-building-a-calorie-counter - Step 74

I’ve tried a variety of ways to get this step but I am missing something… Any Suggestions?

function calculateCalories(e) {
e.preventDefault();
if (isError = true) {
return;
}
const breakfastNumberInputs…

I did delete the isError = false but have tried without deleting.

Any guidance would be appreciated.

I have also tried with = , ==, === for: ( isError === true)

Scrolling down a bit, in the given code, you find the following example.

    if (invalidInputMatch) {
      alert(`Invalid Input: ${invalidInputMatch[0]}`);
      isError = true;
      return null;
    }

Notice the condition for that if .
Stripping it down we end-up with:

    if (invalidInputMatch) {
       return;
    }

Is that not very similar to what it is asking? Instead of invalidInputMatch is asking for isError

I’ve now tried a bunch of iterations of the suggestion above. I must be missing something because it doesn’t seem like it should be as hard as it is. :thinking:

You had this before.

Please, re-read what I said previously and compare with what you did there. Notice that the only think you have to do is to remove the = true out of it.
If still, you find no success, please, post your code with the attempt.

1 Like

Ahhh… Now I get it! Thank you for your time and expertise. Much Appreciated!
:star_struck:

1 Like