Learn Form Validation by Building a Calorie Counter - Step 65

Tell us what’s happening:

i need help for checking my code ,it give me the same error again and again , i am looking for a solutions everywhere but i am unable to find it

Your code so far

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

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

function getCaloriesFromInputs(list) {
  let calories = 0;

  for (const item of list) {
    const currVal = cleanInputString(item.value);
    const invalidInputMatch = isInvalidInput(currVal);

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

    // Use addition assignment operator after the if statement
    calories += Number(currVal);  // Add the numeric value of currVal to calories
  }

  return calories;  // Return the total calories
}


// User Editable Region
/* file: styles.css */

Your browser information:

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 65

What is the error?

Try to provide all the info / context that you can. Often an error will have a good clue to the solution.

Welcome to the forum @pdaksh163

The comments around your code are interfering with the tests.
Please remove any comments you inserted.

Happy coding

Hi. You were not asked to put a return statement at the end. Your comments are also causing an issue for some reason so remove those as Teller says.