Loops and arrays II Error


Hi Guys,

I hate to be a pain, really I do, but I need assistance. I've attempted to add / delete spaces and semi-colons but whatever I do I cannot get my code to work for this assignment. Can I please get another set of eyes to look at this to see what I'm doing wrong? Thanks in advance!!



Oops, try again. Your code should have printed 'I know someone called Eva', 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 = ["Eva","Chris","Putters","Cady","Angela"];

for (var i=0; i<names; i++) {
    console.log("I know someone called " + names[i]);


It's due to this. You need to write names.length as you want to loop up to the length of names. You will get a error if you just write names.


You're a genius. I thought I did that but I must've deleted it. You've solved my issue.
Thank you!


Haha, no worries man.


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