Loops JavaScript--- 3. For loops


#1



THIS IS MY CODE:

var vacationSpots = ['Paris', 'New York', 'Barcelona'];

for (var i = 0; i < vacationSpots.length; i++) {
console.log('I would love to visit ' + vacationSpots[i]);
}

HELP ME! What am I doing wrong?


#2

What's the error message you're receiving?


#4

Your code is correct. Print error msg please.


#5

I have the same problem, the error message is "Did you console.log vacationSpots[i] within the for loop?"
i can't go forward


#6

Please create your own topic to address this problem. To get sufficient assistance, you'll need to include;
- the exercise URL
- the code you tried
- the error message you received.

Thanks! :slight_smile:


#7

solution: https://discuss.codecademy.com/t/help-learn-javascript-loops-number-3/66897/2


#8

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