Loops and Arrays II


I'm having trouble with submitting this. I don't know what's wrong with my code. Please have a look. Thanks.

var names = ["Billy", "Mike", "Bobby", "Tony", "David"];

for (var i = 0; names.length < 5; i++) {
console.log("I know someone called " + names[i]);


Never mind. I figured it out. Thanks anyways!


What was the issue, @xgee_whiz? Because I'm having the exact same issue and from what I see, my formatting is the same as yours. I'm still stuck on it..


Hey @smondaca, I think what I did here was said "i < names.length" instead of "names.length < 5"

If you think about it, names.length is currently the number of variables the array is holding which is 5. So "5 < 5" wouldn't really work in this case.