Nested loops 5/8 instruction #4


#1

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-javascript-loops/lessons/loops/exercises/for-loops-iii?action=lesson_resume&course_redirect=introduction-to-javascript

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

I’m not seeing where my error is :confused: the instructions are as follows…
4.
You logged all of your places!

Inside of the existing for loop’s block, below the console.log() statement, write another for loop that loops over friendPlaces. This time, rather than using the myPlacesIndex as the variable name, use friendPlacesIndex. Doing so will prevent us from overwriting any variables. Log each of your friend’s places to the console.

```

let myPlaces = [‘one’, ‘two’, ‘three’];
let friendPlaces = [‘uno’, ‘dos’, ‘tres’];
for (let myPlacesIndex = 0 ; myPlacesIndex < myPlaces.length ; myPlacesIndex ++) {console.log(myPlaces[myPlacesIndex]);
for (let friendPlacesIndex = 0; friendPlacesIndex < friendPlace.length ; friendPlaceIndex ++) {
console.log(friendPlaces[friendPlacesIndex]);
};
};

<do not remove the three backticks above>

#2

nvm…i found it…forgot to add an ‘s’ in a few spots…ugh


#3

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