Loops and arrays II (Please help)


#1

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

Syntax error unexpected token


var names = ["Andree", "Katharine", "Steven", "Christian", "Mom"];

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


#2

I keep getting a syntax error and cannot see what I am doing wrong for the life of me. Any help is appreciated.

Best,

Andree


#3

In your for loop, should you separate your code with commas or semicolons?


#4

Thank you biff75, so simple!


#5

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