Iterate over jQuery JSON object in original order

前端 未结 4 1898
误落风尘
误落风尘 2021-01-04 09:13

I\'ve got some json data in a map object which is sorted by time. The key is an integer id and the value is an object which contains a timestamp. However when I try to ite

4条回答
  •  执念已碎
    2021-01-04 09:38

    If by "original" you mean the timestamp in the object, I don't think there's any foolproof option other than to first explicitly sort the array, and only then loop through it.

提交回复
热议问题