Console log every even number

Console log every even number
0

#1

What am I doing wrong? Instead of number I’m trying to print the even number foods


#2

i only refers to the number you declared in the for loop.

Try logging foods with the i index, so

foods[i]


#3
var foods = ["fries", "kebab", "pasta", "raviolli", "coke", "pizza"];

//change var i = 0 instead of 2 to start from the beginning (index 0).
for(var i = 0; i < foods.length; i+=2) { 
//change the (i) to foods[i] to capture the array.
    console.log(foods[i]);
}