12 Loops and Arrays


#1



Oops, try again. There was a problem with your syntax.
I'm stuck. I've looked at solutions and I still can't see what I'm doing wrong. I appreciate the help.


Replace this line with your code. 

var names ["Chris", "Patience", "Paradise", "Shane", "Rennie"];
    for (var i = 0; i < names.length;i ++) 
    {
    console.log ("I know someone called", "+", names[i]);
}


#2

Hi @improviser14

Please see the code sample below. In short you had everything spot on except for the tiny thing that names must be "equal" to something to fully declare a value to it :slight_smile:

var names = ["Chris", "Patience", "Paradise", "Shane", "Rennie"]; //missing the = sign
for (var i = 0; i < names.length;i ++) 
    {
    console.log ("I know someone called", "+", names[i]);
}

#3

Thank you sosooo much! I was staring at the screen for an hour and didn't see it!


#4

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