UNPKG

text0322

Version:

随机整数

7 lines (6 loc) 192 B
//生成制定范围内的随机整数 function getRandomInt(min,max){ return min + parseInt(Math.random() * (max-min+1)) }; //模块导出 module.exports.getRandomInt = getRandomInt;