Learn Form Validation by Building a Calorie Counter - Step 75

Tell us what’s happening:

Getting this error when submitting my code: “You should call getCaloriesFromInputs with [budgetNumberInput] as the argument.”

I initially had budgetNumberInput as the argument, then updated it to [budgetNumberInput] upon seeing this error, but my code still does not pass, not sure what I’m missing.

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([bugetNumberInput]);
}

// 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/129.0.0.0 Safari/537.36 Edg/129.0.0.0

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 75

Hello and welcome to the forum @mandolin8806 !

Good attempt!

I see a small typo, that any of us could make.

It should be budgetNumberInput

When we see a part underlined, it usually is a typo.

Wishing you good progress on your coding journey. :slightly_smiling_face:

Doh! Thanks, just needed another set of eyes apparently. :slight_smile:

1 Like

You are welcome! It happens to us all at times.

As you say, a different set of eyes helps us often.

Keep up the good progress! :slightly_smiling_face:

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