'For' Loops in JS


#1


gives out an error, I can not understand reasons

Oops, try again. Did you remember to use 5 separate console.log() statements?

var names = ["1","2","3","4","5"];
for (var i=0; i < names.length; i++) {
console.log(names[i]);
}


#2

this exercise?

you miss the "i know someone called" string, which should be logged along with the name


#3

No. this Why use for loops?


#5

you are not yet allowed to use a loop yet, see step 2 and 3 of the instructions

and the numbers should be integers, not strings


#6

so that is it needed in this task then to do?

for ( i=1; i <=5; i++) {
console.log(i);
}
so again error
Did you remember to use 5 separate console.log() statements?
ok! I understood


#7

not use a loop, you have to do it manually


#8

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