Learn Form Validation by Building a Calorie Counter - Step 61

it’s giving me this error. You should use a template literal to pass the Invalid Input: message to the alert() function.

function getCaloriesFromInputs(list) {
  let calories = 0;

  for (let i = 0; i < list.length; i++) {
    const currVal = cleanInputString(list[i].value);
    const invalidInputMatch = isInvalidInput(currVal);

    if (invalidInputMatch) {
       alert(`Invalid input: ${invalidInputMatch[0]}`);
    }
  }
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) 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 61

you might want to compare the lowercases vs the uppercases between your code and the steps as the program is very strict on that

No they didn’t say anything about comparison in instucntions

Using a template literal, in your if block, call the alert() function to tell the user Invalid Input: , followed by the first value in the invalidInputMatch array.

The step is asking for "tell the user Invalid Input: "

You put "Invalid input: "

yh got that it’s solved thanks for the help

I didn’t get it. I cant resolve