Loops Exercise - Whats wrong with this


#1

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


I'm a novice. I did some basic BASIC programming many years ago. This is a snippet of my code - I'd correctly defined a myPlaces array. The exercise was to log the elements to the console with a for loop. The output was correct but it wouldn't let me progress - asking me if I'd written a loop to log the elements of myPlaces. In the end I gave up & had to "get code" - which then gave me the code for all the exercises - disappointing as I can't see anything wrong.

#2

Could you present the code which you got…just to see the difference in probably the spacing ??


#3

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