12 loops/arrays


#1


So very confused here, I keep getting the error message but have no idea why



Oops, try again. Your code should have printed 'I know someone called caleb', 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!

var names = ['mike','caleb','aubrey','sarah','luxy'];
for (var i = 0; i > names.length; i++){
console.log("I know someone called " + names[i]);
}


#2

i > names.length

should be

i < names.length


#3

lol, yeah I just figured that out, thanks!


#5

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