标签:
1 function getRandomIntNumber(min, max) { 2 var span = max - min + 1; 3 var result = Math.floor(Math.random() * span + min); 4 return result; 5 }
【前端】JavaScript获取指定范围内的随机整数
原文地址:http://www.cnblogs.com/forzhaokang/p/5203474.html