Loops and arrays


#1


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


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(i=0;i<names.length;i++)
{
    console.log("I know someone called " , +names[i]);
}


#2

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

You need remove one , or + before names[i]


#3

ohhh thank you..:slight_smile:
it was comma..


#4

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