Skip to content

Instantly share code, notes, and snippets.

View romuleald's full-sized avatar
🥳

Antoine Sanchez romuleald

🥳
View GitHub Profile
@romuleald
romuleald / random-beetwen-range-with-not
Created September 29, 2014 16:08
Random number beetwen range, with optional parameter to forbid a specific number
function randomIntFromInterval(min, max, not) {
var _return = Math.floor(Math.random() * (max - min + 1) + min);
if(_return === not){
return randomIntFromInterval(min, max, not);
}
return _return;
}