JavaScript for…in vs for

前端 未结 22 1462
悲哀的现实
悲哀的现实 2020-11-22 07:15

Do you think there is a big difference in for...in and for loops? What kind of \"for\" do you prefer to use and why?

Let\'s say we have an array of associative array

22条回答
  •  执笔经年
    2020-11-22 07:38

    I have seen problems with the "for each" using objects and prototype and arrays

    my understanding is that the for each is for properties of objects and NOT arrays

提交回复
热议问题