points.sort(function(a, b){return b-a});
var status = new Array();
status.push({name: 'BOB', val: 10});
status.push({name: 'TOM', val: 3});
status.push({name: 'ROB', val: 22});
status.push({name: 'JON', val: 7});
status.sort(function(a,b) {
return a.val - b.val;
});
http://www.w3schools.com/jsref/jsref_sort.asp
http://stackoverflow.com/questions/12788051/how-to-sort-an-associative-array-by-value
댓글 없음:
댓글 쓰기