标签: javascript algorithm sorting
我注意到,在使用数字键在对象上运行for in时,我很好奇。这些项似乎一直在返回排序。任何人都能解释为什么会这样?
for in
const thing = { "2": "any", "8": "thing", "3": "here", "7": "x", "6": "xx", "1": "xxx" }; for (var item in thing) { console.log(item); }