SOURCE

function writeDocument(variable){
    document.write(variable + "<br/>")
}

writeDocument("最大值最小值-----------")
writeDocument("最大值:"+Math.max(1,3,9,10,18,999));
writeDocument("最小值:"+Math.min(1,3,9,10,18,999));

writeDocument("生成四位随机码-------------")

function generateVerifyCode(length){
    var strLetterNumber="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var code ="";
    for(var i=0;i<length;++i){
        var randonNumber = Math.floor(Math.random()*strLetterNumber.length);
        code=code+strLetterNumber.charAt(randonNumber);
    }

    return code;
}
writeDocument(generateVerifyCode(4));
writeDocument(generateVerifyCode(5));
writeDocument(generateVerifyCode(6));

writeDocument("生成随机的颜色 rgb(255,255,255)-------------------")

function generateRandowColor(){
    var red = Math.floor(Math.random()*256);
    var green = Math.floor(Math.random()*256);
    var blue = Math.floor(Math.random()*256);

    writeDocument("rgb("+red+","+green+","+blue+")");

}generateRandowColor();
console 命令行工具 X clear

                    
>
console