sort简洁写法

arr.sort(function (a, b){ return a - b; }); //正序排列数字

arr.sort(function (a, b){ return b - a; }); //倒序排列数字

posted @ 2017-02-21 10:49  绯红的花io  阅读(161)  评论(0编辑  收藏  举报