Help me check this code if there is something wrong, especially for loop


#1

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

for(var i = 0; i < vacationSports.length; i++) {
console.log(vacationSports[i]);
}


#2

Hi @wilsonmajok

The only thing I could see that would be an issue is the use of your variable name. you declare "vacationSpots" (no r), but measure for the length of "vacationSports" (there is the letter 'R' in here).

Try dropping that and seeing if it helps at all :slight_smile:
If not please post back the exact error you may be getting and someone will try to help as soon as they can.


#3

Thanks @mike_in_training it works. It is funny how that simply problem made me sweat. :slight_smile: :sweat:


#4

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