What's the fastest way to iterate over an object's properties in Javascript?

后端 未结 8 1686
旧巷少年郎
旧巷少年郎 2020-12-13 00:25

I know that I can iterate over an object\'s properties like this:

for (property in object)
{
    // do stuff
}

I also know that the fastest

8条回答
  •  攒了一身酷
    2020-12-13 01:04

    An object's properties are unordered by definition. The lack of order means that there is no "forwards", and therefore there is no "backwards" either.

提交回复
热议问题