Sorry folks, but could any one spot what I'm doing wrong here?


#1

Sorry folks, but could any one spot what I'm doing wrong here? I'm really new to all kinds of coding.

var = names ["Kev", "Rory", "Robert", "Ian", "Taghd"];
for (var i = 0; i < names.length; i++)
{
console.log("I know someone called " + " " names[i]);
}

I've compared it against a lot of codes and I ca't see an issue but it will not print.
If possible could you explain what I'm missing.

SyntaxError: Unexpected token '='. Expected a parameter pattern or a ')' in parameter list.

Is there error I'm getting. I'm sure It's something obvious to those who know more but any help would be appreciated.

Thanks a million


Code not working for 12?
#2

don't use semicolon(:wink: after the for loop.


#3

Swap names and the equals sign.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.