Loop and Array 2


#1


Loops and arrays II


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


var names= ["A" , "B", "C", "D", "E"];
for (var i=0; i<4; i++);
{
    console.log("I know someone called " + names[i]);
    }


#2

for (var i=0; i<4; i++); // unnecessary semi-colon

#3

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