Error in Loops and arrays II


#1


Hello, I have a question. I got an error (Oops, try again. Your code should have printed 'I know someone called Noah', but didn't. Make sure to type the 'I know someone called ' part exactly right, and don't forget the space between that phrase and the name!)
i tried everything I can think of but nothing works.

I already checked with the code from "Loops and arrays I" and they look simular.

hope someone can help me.


var names = ["Noah","Jessica","Coen","Shiva","Drakie"];

for (var i = 0; i < name.length; i++) {
    console.log ("I know someone called" +" "+ names[i]);
}


#2

Should be,

i < names.length;

#3

it works now.

i've been starring at it for more than half an hour.

thank you very much.


#4

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