取两个数之间的随机数以及取数组的最大值

1.取两个数之间的随机数
Math.floor(Math.random()*两个数之间可能出现的总数+最小数)
2.取数组的最大值
var arr = [1,45,15,151,545,484,5]
Math.max.apply(Math,arr)

猜你喜欢

转载自blog.csdn.net/m0_37715518/article/details/89023242