Loops and arrays II, what am I doing wrong?


#1

var names = [“Maxime”, “Bobbie”, “Ashly”, “Josh”, “Luna”];
for (var i = 0; i < names.lenght; i ++) {
console.log(“I know someone called” +" "+ names[i]);
}

This is my code, can someone please tell what I am doing wrong?


#2
for (var i = 0; i < names.lenght; i ++) {

Do you see the misspelling :slight_smile: Also: i ++ is incorrect I believe, it should probably not have that space: i++ :slight_smile:

Hint if you absolutely need it: length

Hope this helps!


#3

Thanks, that helps a lot!


#4

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