js工具函数:随机生成规定范围内的整数
function randomFn(min, max) {
return Math.floor(Math.random() * Math.floor(max - min)) + min;
}
randomFn(2,6) // 3
function randomFn(min, max) {
return Math.floor(Math.random() * Math.floor(max - min)) + min;
}
randomFn(2,6) // 3