Looping by Hand error


#1

https://www.codecademy.com/courses/learn-javascript/lessons/loops/exercises/manual-loop?action=lesson_resume&link_content_target=interstitial_lesson

It asks me "Did you console.log vacationSpots[0]?"

Not sure why it wont print on separate lines. It won't let me move on. I've tried switching the property access to in between curly braces after empty parentheses and putting vacationSpots in the parentheses.

Any help would be great... Seems simple but apparently I can't get it.

var vacationSpots= ['belize', 'fiji', 'Sweden'];

console.log(vacationSpots[0], vacationSpots[1], vacationSpots[2]);


#2

Try to use for loop, example:

var array = [1, 2, 3];
for (var i = 0; i < array.length; i++) {
  console.log(array[i]);
}

#3

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