一、数组排序 默认为字符串类型的排序, 通过字母排序。
二、对数字进行排序, 需要自定义一个比值函数。
arr.sort(function(a, b){return a > b});//降序 arr.sort(function(a, b) {return a < b});//升序