Appearance
@pmun/utils / randomInt
function randomInt(min, max): number;
生成指定范围内的随机整数(包含边界值)
number
最小值(包含)
最大值(包含)
指定范围内的随机整数
randomInt(1, 10) // 返回 1 到 10 之间的随机整数,包括 1 和 10 randomInt(0, 1) // 返回 0 或 1 randomInt(5, 5) // 总是返回 5