Loops and array ii


#1

Nothing seems wrong to me but something seems wrong to codecademy.

// Click on "Stuck? Get a hint!" if you get stuck!
var names = ["Fred", "Luke", "Tom", "Britt", "Jason"];
for (var i = 0; i < names.length; i++) {
    console.log("I know someone called " + " " names[i]);
}

ERROR MESSAGE: SyntaxError: missing ) after argument list


#2

You have an unnecessary space added.


#3

Fixed that. Still getting error message.
Refreshed broweser too.


#4

Maybe it should be:

names.length()

#5

I tried again. Same error


#6

The error shows that it has to do with a bracket but all my brackets are closed.


#7

@draygglez I tried your code with @cadecodes's first suggestion applied, but not the second one, and didn't get any errors when I ran it.
For reference, here's what I ran:

var names = ["Fred", "Luke", "Tom", "Britt", "Jason"];
for (var i = 0; i < names.length; i++) {
    console.log("I know someone called " + names[i]);
}

Would you mind posting a link to the exercise?


#8

I copy and pasted the code you just gave and it went through. The space was the problem. Thanks you both