Learn Form Validation by Building a Calorie Counter - Step 61

Tell us what’s happening:

Hi everyone,
I’m a bit confused and could use some help. Tutor gave me this feedback:
“You should call the cleanInputString function inside the getCaloriesFromInputs function.”
However, I feel like that’s exactly what I did in my code.

Your code so far

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

/* file: styles.css */

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

const currVal = cleanInputString(item.value);
     calories += Number(currVal);
  } 
  return calories;
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 61

Hi there!

The above was instructed, you already done it.

Then why you added that extra code

1 Like

Thanks for your reply, I tried that first but I get the same message and this error message:
[ReferenceError: getCaloriesFromInputs is not defined]. I can’t figure out what the problem is.

reset the step and try again, it looks like your changes caused a syntax error maybe

1 Like

I had an extra curly bracket that was causing the error. thank you guys!