Tell us what’s happening:
Hi! I have already read the exercise multiple times and i still cant figure out why my answer is not working.
I get the following error: You should use template literal syntax to display the first value in the invalidInputMatch
array after the Invalid Input:
text.
Your code so far
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].value}`);
}
}
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
Challenge Information:
Learn Form Validation by Building a Calorie Counter - Step 61