Math对象还包含许多方法,用于辅助完成简单和复杂的数学计算. 其中,min()和max()方法用于确定一组数值中的最小值和最大值.这两个方法都可以接受任意多个数值参数,如下例子: var max = Math.max(3,54,32,16); alert(max);//54 var min = Math.min(3,54,32,16); alert(min);//3 对于3.54.32和16,Math.max()返回54,而Math.min()返回3.这两个方法经常用于避免多余的循环和在if语…