[
{"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})
Sorting an array of 10 objects works great, as soon as the number of objects exceeds 10, sorting is not performed in Chrome for Mac. Safari is not suitable for any array size. (Works great in Firefox)
What is the correct way to sort arrays of objects using javascript?
source
share