For 10000 order numbers, the required order numbers range from 0 to 9999, completely random and irregular.

thanks

Mar.24,2021

create an array of size 10000, fill in 0-9999 times, and then scramble it with random numbers


const arr = [];
for(let i=0;i<10000;iPP){
    arr.push(i);
}

function random(arr){
    if(arr.length===0){
        return null;
    }
    const index = Math.floor(Math.random()*arr.length);
    return arr.splice(index, 1)[0];
}

random (arr) you can get random numbers

Menu