Move object element position in javascript

后端 未结 3 1054
旧巷少年郎
旧巷少年郎 2021-01-25 12:13

I\'m trying to find a way to move an object element to a specific position.

For example, I\'ve this object :

{
    \"element1\" : {} // object,
    \"el         


        
3条回答
  •  忘了有多久
    2021-01-25 12:44

    Objects in JavaScript are essentially hash maps. Their properties don't have any ordering, per se. They are simply name value pairs.

    You are probably confusing objects with arrays, in which case ordering does indeed matter.

提交回复
热议问题