12. for loop and array II


Could you guys please tell me what is the error in this code?
/ Click on "Stuck? Get a hint!" if you get stuck!

var names = ["jan", "feb", "mar", "apr", "may"];
for(i = 0; i < names.length; i++){
    console.log("I know  someone called " + names[i]);


your code is absolutely fine.what's the error messagese?


now I got the error... error is the double spacing between "know someone" ... Is spacing really mattter?


in console.log,must be"I know someone called " + names[i],
not"I know someone called " + names[i]
you added a little space between "know" and "someone" but it shoud not have :slight_smile:
Reply if you can read this


var names = ["Tomek","Kasia","Lucyfer","Unabomber","Starik"];
for (var i = 0; i < 5; i++)
console.log("I know someone called" + " " + names[i]);


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