Please help urgently please !11/13 js


#1

come someone please explain to me wtf are they tryingg to teach me in part 11/13. especially the bit it says that "cities,length is equal to 4" what on earth, i swear it dosent , so i must be misunderstanding what they are trying to teach me,


#2

Do you mind posting your code so that we may be able to assist? I'm not sure where your error is occurring.


#3

"cities.length equals to 4" means that the number of elements in the cities array is 4 (length of the array also means the size of the array). Therefore, the loop will run 4 times. The reason why the code doesn't simply state the length/size of the array, such as i < 4, is useful in case you don't know the length/size of your array. Writing it as cities.length will make sure your loop goes through the whole array.
Hope this helps.


#4

oh ok thank you for this information.:smile:


#5

thanks for the help.i understand it now