12. Loops and arrays II "SyntaxError: missing ) after argument list"


#1



Not sure why I get this error message.

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


SyntaxError: missing ) after argument list


var names = ["cat", "taro", "hanako", "momo", "noboru"];

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


#2

HI this line

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

add a + before names[i] to concatenate the string with your name


#3

You're missing the concatenate sign.

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

#4

I see! Thanks a lot wizmarco :slight_smile:


#5

I see! Thanks a lot bayoishola20 :slight_smile:


#6

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