jeudi 24 novembre 2022

Exclude certain numbers from a range of random numbers in JavaScript [duplicate]

I am trying to generate random numbers. I do it like this:

function getRandom(min, max) {
        return  Math.random() * (max - min) + min;
}

I'm trying to get a number in the range from 0 to 100. Excluding the range from 40 to 60 from the answer How to do it?




Aucun commentaire:

Enregistrer un commentaire