Tell us what’s happening:
I tried declaring the item variable in the for…of loop but still didn’t work, the instructions say I should use const to declare the variable called item, I tried writing my code as for (const item of list) { }
but still didn’t work, someone assist me please.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function getCaloriesFromInputs(list) {
let calories = 0;
const item;
for (const list of item){
}
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0
Challenge Information:
Learn Form Validation by Building a Calorie Counter - Step 59