求数组中的最大最小值

var a=[1,2,3,5];
alert(Math.max.apply( null , a)); //最大值
alert(Math.min.apply( null , a)); //最小值

猜你喜欢

转载自www.cnblogs.com/weiqian/p/9053168.html
今日推荐