Intro to for loops II ughhhh


#1

var names = ["Bob", "Joe", "Nick", "Sam", "Dan"]
for (i = 0; i > 4; i++) {
console.log("I know someone called " + names[i] + ".")
}
DOESN"T WORK WHYYYYYYY :frowning:


#2

The loop has an incorrect conditional. It should be less than (<)

    for (var i = 0; i < names.length; i++) {

If you are still getting an error message, remove + "." from the output. It is not asked for.


#3

Oops, try again. Your code should have printed 'I know someone called Bob', 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!
thanks, I fixed it so it does thing right, but it give the error above


#4

never mind. sorry. :frowning:
EXTRA CHARACTERS