最大、最小值

1、一串数中最大、最小值

Math.max(10, 5, 2, 9); // 10
Math.min(10, 5, 2, 9); // 2

2、数组中的最大、最小值

Math.max.apply(null, [10, 5, 2, 9]); // 10
Math.min.apply(null, [10, 5, 2, 9]); // 2
原文地址:https://www.cnblogs.com/Zting00/p/7497667.html