JavaScript计算自定义范围的整数随机数 2016-11-29 本文已影响52人 sphsyv function rnd(start, end){ return Math.floor(Math.random() * (end - start) + start); }