1 function getRandomIntNumber(min, max) { 2 var span = max - min + 1; 3 var result = Math.floor(Math.random() * span + min); 4 return result; 5 }