小编Joh*_*ohs的帖子

在Chrome中对超过10个对象的数组进行排序

[
{"tag":"fujairah","count":1},
{"tag":"worldwide","count":3},
{"tag":"saudi","count":1},
{"tag":"miami","count":1},
{"tag":"rwo-dealer","count":7},
{"tag":"new york","count":2},
{"tag":"surabaya","count":1},
{"tag":"phillippines","count":1},
{"tag":"vietnam","count":1},
{"tag":"norway","count":1},
{"tag":"x","count":1}
].sort(function(a,b){return a.tag>b.tag})
Run Code Online (Sandbox Code Playgroud)

对10个对象的数组进行排序工作正常,一旦对象数超过10,Chrome for Mac中的排序就会失败.Safari在任何阵列大小都失败.(在Firefox中正常工作)

通过javascript排序对象数组的正确方法是什么?

javascript arrays sorting safari google-chrome

5
推荐指数
1
解决办法
1141
查看次数

标签 统计

arrays ×1

google-chrome ×1

javascript ×1

safari ×1

sorting ×1