摘要: 1、直接排序 var arr = [1,3,2,5]; function compare(a,b){ return a - b;//从小到大 return b - a;//从大到小 } console.log(arr.sort(compare)); 2 嵌套排序 按照数组中的某一项value值进行排 阅读全文
posted @ 2017-08-02 15:46 伊优 阅读(304) 评论(0) 推荐(0) 编辑