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