Learn Form Validation by Building a Calorie Counter - Step 56

Tell us what’s happening:

i dont know what to do I think this is right but something is missing

Your code so far

function getCaloriesFromInputs(list) {
  let calories = 0;
for (const item of itemArray) {

}

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 56

"Create a for...of loop that loops through the → list ← "

What list do you think the instructions are referring to here? Your code is looping through itemArray. Where is that variable coming from?

function getCaloriesFromInputs(list) {
  let calories = 0;
for (const item of list) {

}

i put this but they arent taking this either

Hi @Ismail8

Try closing the function with a curly brace.

Happy coding

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.