Let's replace your current code with a loop.

Write a for loop that loops through your vacationSpots array.

Inside the block of the for loop, use console.log to print each item in the vacationSpots array.


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

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

Did you console.log vacationSpots[i] within the for loop?

Can someone please help? I do not understand my error.


Did it say to add this?

As far as errors, it works and looks fine to me.


Nope it didn't say to add that, I just though I might throw it in, but it was causing the problem I was having. Thanks for helping! =)


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