Learn Form Validation by Building a Calorie Counter - Step 78

Tell us what’s happening:

Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

 const consumedCalories = breakfastCalories + lunchCalories + dinnerCalories + snacksCalories;
  const remainingCalories = budgetCalories - consumedCalories + exerciseCalories;
  const surplusOrDeficit = remainingCalories >= 0 ? 'Surplus' : 'Deficit';

  output.innerHTML();
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) 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 78

There are two problems here.

The first is that you appear to be trying to call the function output.innerHTML(). What you actually need to do is just as the lesson states:

Start by assigning an empty template literal to the innerHTML property of the output element.

The first fix to make is to change your code from calling a function to assigning a value to output.innerHTML. You can do this with the assignment operator =.

The second problem is the value assigned needs to be an empty template literal, which can be written using back ticks ``.

2 Likes