Loops and arrays II ERROR


#1

Introduction to 'For' Loops in JS
Loops and arrays II link
https://www.codecademy.com/courses/javascript-beginner-en-NhsaT/2/4?curriculum_id=506324b3a7dffd00020bf661#

I can't figure out my mistake. Please help!

This is what it's saying (ERROR MESSAGE) -
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!

My code -

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

#2

What have you done so far to solve this problem?

The error message describes a problem, do you agree with that problem, do your own observations match that?
What would some possible explanations be, and how can you test if those are indeed the problem?
What steps should the code be carrying out in order to produce the desired result? If followed, which of those steps would prevent the current behaviour?


#3

Thank you for advice I did observe it again.
I do except the mistake was silly.
Next time I'll remember what you said.


#4

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