Loops and arrays II


#1


I'm stuck here and I can't find the mistake. I red a few discussions about this excercise but there were no comments who
could help me to solve the problem.


https://www.codecademy.com/en/courses/javascript-beginner-en-NhsaT/2/4?curriculum_id=506324b3a7dffd00020bf661


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

// Click on "Stuck? Get a hint!" if you get stuck!
var names=["Lars","Hans","Lutz","Gerd","Ursula"];
for (var i =0; i <names.length; i ++) {
    console.log("I know someone called"+ names[i]);
}


#2

console.log("I know someone called"+ names[i]);

add a space after called like so:
console.log("I know someone called "+ names[i]);


#3

in the console log, after the + you need to add quotes as a space like so:

  console.log("I know someone called"+" "+ names[i]);

#4

designer and sumo are both right. Your code is valid, but the problem is technical.
You must follow every detail of instruction. That's just the way the (application) console works ('You'll meet more of these in future). "Leave a space".


#5

Thanks ! That helped a lot


#6

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