JS 取得一个区间的随机整数

时间:2022-04-16 20:49:25

function rnd(n, m){
        var random = Math.floor(Math.random()*(m-n+1)+n);
        return random;
    }