因为sort排序是根据字符串顺序对值进行排序,所以当对数字进行排序时需要结合比值函数使用var points = [40, 100, 1, 5, 25, 10]; points.sort(function(a, b){return a - b});