var
array = [[1,2,10],[1,9,8],[8,2,7],[8,10,1],[5,10,2]];
array.sort(
function
(a, b){
if
(a[0] == b[0]){
return
a[2] - b[2];
}
return
a[0] - b[0];
});
console.log(array);
摘自:http://bbs.csdn.net/topics/390743475
解读: