function writeDocument(variable) {
document.write(variable + "<br/>");
}
writeDocument("=====================")
writeDocument("最大值:"+Math.max(1,3,4,10,18));
writeDocument("最小值:"+Math.min(1,3,4,10,18));
writeDocument("=====================")
function generateVerifyCode(length){
var strLetterNumber="0123456789ABCDEFGHIJKLMNOPQRST";
var code="";
for(var i=0;i<length;++i){
var randomNumber=Math.random()*strLetterNumber.length;
code =code+strLetterNumber.charAt(randomNumber);
}
return code;
}
writeDocument(generateVerifyCode(4));
writeDocument(generateVerifyCode(5));
writeDocument(generateVerifyCode(6));
writeDocument("=====================")
function getRandomColor() {
var r = Math.floor(Math.random() * (255 + 1));
var g = Math.floor(Math.random() * (255 + 1));
var b = Math.floor(Math.random() * (255 + 1));
var rgb = "rgb(" + r + "," + g + "," + b + ")";
return rgb;
}
writeDocument(getRandomColor());
console