js生成一定范围内的随机整数

Math.floor(Math.random() * (50 - 1 + 1) + 1);

生成1-50内的随机整数

猜你喜欢

转载自www.cnblogs.com/mmykdbc/p/11290425.html