12/13 For loops and arrays || (help pls)


#1

var names = ["Allie", "Taylor", "Saul", "Thomas", "Maxwell"];
for(var i = 5; i < names.length; i++) {
console.log("I know someone called " + names[i]);
};

//Someone helps me please. It keeps saying "Your code should have printed 'I know someone called Allie', 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!".


#2

Never mind, I fixed it


#3

You need to initialize the increment count at 0 not 5.

See in your for loop: for (var i = **5**; i < names.length; i++) { ...

The logic here is that at 5 it will never enter into the loop because 5 is names.length, not less than.

edit: glad you fixed it!