12 loops and arrays II


Help me! It just keeps saying: syntaxerror: expected ;

var names["Lily", "Simon", "Mia", "Nathan", "Harry"];
for(i = 0; i < names.length; i++){
console.log("I know someone called " +name[i]);

Replace this line with your code.


Hi this line

var names["Lily", "Simon", "Mia", "Nathan", "Harry"];

it's missing the = after var names


Thanks but it just says:
Your code should have printed 'I know someone called Lily', 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!


You used name instead of names[i].


Ah, that was it. Thanks


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