Skip to content

Instantly share code, notes, and snippets.

View davidjsalazarmoreno's full-sized avatar
🔥
Creating

David Salazar davidjsalazarmoreno

🔥
Creating
View GitHub Profile
function randInt(min,max){
var range = max - min;
// it actually does work the other way...
// if (range < 0) { throw new RangeError("min must be less than max"); }
var rand = Math.floor(Math.random() * (range + 1));
return min + rand;
}