Build a Calorie Counter - Step 82

Tell us what’s happening:

i donno what’s wrong still, i interpolate the class with the requirements , any hint here ? thank you <3

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

function calculateCalories(e) {
  e.preventDefault();
  isError = false;

  const breakfastNumberInputs = document.querySelectorAll("#breakfast input[type='number']");
  const lunchNumberInputs = document.querySelectorAll("#lunch input[type='number']");
  const dinnerNumberInputs = document.querySelectorAll("#dinner input[type='number']");
  const snacksNumberInputs = document.querySelectorAll("#snacks input[type='number']");
  const exerciseNumberInputs = document.querySelectorAll("#exercise input[type='number']");

  const breakfastCalories = getCaloriesFromInputs(breakfastNumberInputs);
  const lunchCalories = getCaloriesFromInputs(lunchNumberInputs);
  const dinnerCalories = getCaloriesFromInputs(dinnerNumberInputs);
  const snacksCalories = getCaloriesFromInputs(snacksNumberInputs);
  const exerciseCalories = getCaloriesFromInputs(exerciseNumberInputs);
  const budgetCalories = getCaloriesFromInputs([budgetNumberInput]);

  if (isError) {
    return;
  }

  const consumedCalories = breakfastCalories + lunchCalories + dinnerCalories + snacksCalories;
  const remainingCalories = budgetCalories - consumedCalories + exerciseCalories;
  const surplusOrDeficit = remainingCalories < 0 ? 'Surplus' : 'Deficit';
  output.innerHTML = `<span class='${surplusOrDeficit.toLowerCase()}'></span>`;
}

// User Editable Region

Your browser information:

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

Challenge Information:

Build a Calorie Counter - Step 82

try using double quotes (") instead of single quotes

oh is there a big difference between them , i used to use single quotes

I mean, is this strict using double quotes have a goal i need to get it with , or just the same thing as i know

html tends to use double quotes, but you can request that single quotes be accepted by opening an issue on github

1 Like

maybe i will, i think it’s not the first time i fail to pass because of these quotes . thank you so much for helping

note you would need to open an issue for each instance (or list in the issue all instances), as it depends on the tests written for that specific step

maybe it’s very complicated than i thought, so i may get lazy about it

could i suggest something about challenges, you put something like mark to specifiy the level for the challenge for example easy - medium - hard
so i could specifiy if i need to delay it for sometime .
you know what sometimes i find a complicated challenge , and next challenge to it so so easier than it . you got what i mean ?