UNPKG

@ssports_fe/ssutils

Version:
13 lines (11 loc) 257 B
/** * * @desc 生成指定范围[min, max]的随机数 * @param {Number} min * @param {Number} max * @return {Number} */ const randomNum = (min, max) => { return Math.floor(Math.random() * (max - min + 1)) + min; }; module.exports = randomNum;