Intro to loops and arrays(2) 12


#1

What's wrong with my code?

Oops, try again. There was a problem with your syntax.
SyntaxError: Unexpected token [

var names ["Gen", "Jen", "Eel", "Bob", "Ngo"];

for(var i=0;i console.log("I know someone called "+ names[i];}

`


#2

You need an = between names and [


#3

var names=["Gen", "Jen", "Eel", "Bob", "Ngo"];

for(var i=0;i console.log("I know someone called "+ names[i]);}

Oops, try again. Your code should have printed 'I know someone called Gen', 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

Have a look at your code:

for(var i=0;i 
console.log("I know someone called "+ names[i]);
}

have a look at this example:

for (var i = 0; i < someNum; i ++) {
    console.log(something);
}

#5