The inner for loop is confusing, how do I set this up?


#1

Question

The inner for loop is confusing, how do I set this up?

Answer

Try not to think too much about this at first. Right now create your outer for loop that goes through your myPlaces array, similar to the last exercises. Now on the inside of this for loop, do the same thing and create a for loop to loop through your friendsPlaces array. Now, on the inside of this inner for loop, is where you work your magic, you get to check if myPlaces at index myPlacesIndex is equal to friendsPlaces at friendsPlacesIndex. If they’re both equal print one of them out and you’re good to go!