function getRandomNumber(min,max){ min = Math.ceil(min); //向上取整 max = Math.floor(max); //向下取整 Math.round(num) 四舍五入 return Math.floor(Math.random()*(max-min+1)+min) }
getRandomNumber(5,10)