徐总多门店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
328 B

5 months ago
/**
* 获取一个指定范围内随机数
*
* @param {Number} minVal 最小值
* @param {Number} maxVal 最大值
* @return {Number}
*/
function random (minVal, maxVal) {
return minVal >= maxVal ? minVal : ((minVal = minVal >> 0) + Math.round(Math.random() * ((maxVal || 9) - minVal)))
}
module.exports = random