var arr = [10, 5, 11, 7, 8, 9];
arr.sort(function (a, b) {
return a - b;
})
console.log(arr[arr.length - 1] - arr[0]);
04-28
1105
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-16
09-04
7756
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交