Loops and arrays 2


#1

var names = ["noah","james","jay","basil","rico"]
for(var i = names[1]; i <= names.length; i++) {
console.log("I know someone called " + names[i]);
}

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!

what am i doing wrong?


#2

I'm not sure how to explain it but feel free to look at mine (it worked)

var names = ["Sam", "Meg", "Rose", "Erin", "Flora"];
for (var i = 0; i < names.length; i ++){
console.log("I know someone called " + names[i]);
}