标签:ret div dom rand turn result select func math
1 function selectNum(lowNum,upNum) { 2 var num = upNum-lowNum+1; 3 // Math.floor() 向下取整 4 return Math.floor(Math.random()*num+lowNum); 5 6 } 7 8 var result = selectNum(2,8); //2~8范围内的整数
标签:ret div dom rand turn result select func math
原文地址:http://www.cnblogs.com/luweib/p/7932097.html