document.write('<br>求最大最小值----------------</br>');
document.write('最大值等于'+Math.max(1,3,4,8,10)+'</br>');
document.write('最小值等于'+Math.min(1,3,4,8,10)+'</br>');
Math.PI
Math.floor();
Math.ceil();
Math.random();
document.write('<br>生成4位数的随机码----------------</br>');
function generateVerifyCode(length){
var strLetterNumber="01234567abcdefg";
arr=strLetterNumber.split("");
var code='';
for(var i=0;i<length;++i){
var n = Math.floor(Math.random() * arr.length);
code+= arr[n];
}
return code;
}
document.write('4位随机码为:'+generateVerifyCode(4)+'</br>');
document.write('<br>生成随机颜色RGB----------------</br>');
function Color(){
var r=Math.floor(Math.random()*256);
var g=Math.floor(Math.random()*256);
var b=Math.floor(Math.random()*256);
document.write('r:'+r+' '+'g:'+g+' '+'b:'+b);
}
Color();
console