12.Loops and Arrays II HELP


#1

Help!


12. Loops and arrays II

SyntaxError: Expected ';'

. // Click on "Stuck? Get a hint!" if you get stuck!
var names ["Arturo", "Eddie", "Mac", "Mary", "Isabel"];

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


#2

which excercise is this and which unit is it in?


#3

nevermind, found it. I will reply soon with your solution! :relaxed:


#4

@pokerchip28 thank you


#5

You forgot to put the declaration equal sign when you declared the array of names, and there's a period right before the comment in your code. Other than that! Nice array! :smiley:


#6

your code should look like this:

// Click on "Stuck? Get a hint!" if you get stuck!
var names = ["Arturo", "Eddie", "Mac", "Mary", "Isabel"];

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


#7

dang. simple mistake, very much appreciated :grin:


#8

yep happens to people all the time, even me! Keep coding! And you're very welcome!


#9

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