Javascript获取数组中的最大值和最小值的方法总结 方法一:可以使用自带的sort()函数。 方法二:使用某种排序法,将数组排序,再取首尾两个值。 方法三:用Math.max和Math.min方法 ...