js之Math对象

        var num = Math.random()*;
var num1 = Math.floor(num); // 向下取整
var num2 = Math.ceil(num); // 向上取整
document.write(num2+'-<br>');
document.write(num1); // 1-10 随机数
var a = Math.floor(Math.random()*+);
console.log(a); function selectForm(min,max){
var ta = max - min + ;
return Math.floor(Math.random() * ta + min);
}
console.log(selectForm(,)); var colors = ["red","gree","blue","yellow","black"];
var color = colors[selectForm(,colors.length-)];
console.log(color);
上一篇:Eclipse的Tomcat热部署,免重启的方法


下一篇:[SPOJ 4155]OTOCI