1.直接排序 var arr = [1,3,2,5]; function compare(a,b){ return a - b;//从小到大 return b - a;//从大到小 } console.log(arr.sort(compare)); 2 嵌套排序 按照数组中的某一项value值进行排序,property为属性值 var arr = [ {name:'jim',age:27}, {name:'tony',age:40}, {name:'jane',age:36}, {name:'l