Loops and arrays II, what am I doing wrong?


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?

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!


Thanks, that helps a lot!


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