Loops


#1

Can someone please let me know where is my mistake

let myPlaces = [‘Costa Rica’,‘China’, ‘Japan’]
let friendPlaces = [‘Hong Kong’, ‘Japan’, ‘Brasil’]

for (let myPlacesIndex = 0; myPlacesIndex < myPlaces.length; myPlacesIndex++) {
console.log(myPlaces[myPlacesIndex]);
for (let friendPlacesIndex = 0; friendPlacesIndex < friendPlaces.lenght; friendPlacesIndex++) {
console.log(friendPlaces[friendPlacesIndex]);
}
}

Thanks


#2

Hi @neriyah,

Check the spelling. :wink:


#3

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