* 获取随机整数 * @param {number} min - 最小值 * @param {number} max - 最大值 * @returns {number}
(min, max)
| 101 | * @returns {number} |
| 102 | */ |
| 103 | function randomInt(min, max) { |
| 104 | min = Math.ceil(min); |
| 105 | max = Math.floor(max); |
| 106 | return Math.floor(Math.random() * (max - min + 1)) + min; |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * 按比例随机波动数值 |
no outgoing calls
no test coverage detected