12 loops and arrays II


#1

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.


#2

Hi this line

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

it's missing the = after var names


#3

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!


#4

You used name instead of names[i].


#5

Ah, that was it. Thanks


#6

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