Loops number 3 part 2


#1

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
so i have typed this:
var vacationSpots=[‘London’, ‘Australia’, ‘New York City’];
for (var i = 0; i< vacationSpots.length; i++){
console.log('I would love to vist ’ + vacationSpots[i]);
}

and it is telling me that "Did you log all the places you’d like to visit to the console?
"
i think i did but i dont know what is happening help me please






#2

can you please post the link of the lesson?


#4

Without the link to the exercise we can’t help much.

@digitalninja57678,

Do you check is it because of this?

console.log('I would love to vist ’ + vacationSpots[i]);

Try correcting the spelling error see if it works.


#5

var vacationSpots=[‘London’, ‘Australia’, ‘New York City’];
for (var i = 0; i< vacationSpots.length; i++){
console.log('I would love to vist ’ + vacationSpots[i]);
}

you forgot the space after the ‘i’.

i< vacationSpots.length

should be…

i < vacationSpots.length

If this doesn’t work I’m not sure, I’m at the same stage as you, just started learning :slight_smile:

var vacationSpots=[‘London’, ‘Australia’, ‘New York City’];
for (var i = 0; i< vacationSpots.length; i++){
console.log('I would love to vist ’ + vacationSpots[i]);
}

Also, put a space between your parenthesis and curly bracket.

Like this:

for (var i = 0; i < vacationSpots.length; i++) {


#6

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