SOURCE

function writeDocument(variable) {
    document.write(variable + "<br/>");
} 
writeDocument("....***...生成最大值,最小值.................");
writeDocument("最大值:"+Math.max(1,3,6,9,18,27,999));
writeDocument("最小值:"+Math.min(1,3,6,9,18,27,999));

//生成随机验证码
writeDocument("生成随机数..................");
var str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
        var arr = str.split("");
        var result = "";
        for(var i=0;i<4;i++)
        {
            var n = Math.floor(Math.random() * arr.length);
            result += arr[n];
        }
        document.write(result)+"<br/>";

writeDocument("<br/>"+"生成随机的颜色,rgb(255,255,255).................");
var rgb="1,3,5,6,15,36,45,38,4,255,4,133,5,15,123456";
function color(){
    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+")");
}
color();
console 命令行工具 X clear

                    
>
console