SOURCE

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

writeDocument("最大最小")
writeDocument("最大:"+Math.max(1,35,7,9,8,16,8456));
writeDocument("最小:"+Math.min(1,35,7,9,8,16,8456));

writeDocument("");

writeDocument("4位随机");
function code(length){
    var number="0123456879ABCDEFGHIJKLMN"
    var code="";
    for(var i=0;i<length;++i){
        var ran=Math.floor(Math.random()*number.length);
        code=code+number.charAt(ran);
    }
    return code;
}
writeDocument(code(4));
writeDocument("");

writeDocument("随机颜色");
function color(){
    var ran=Math.floor(Math.random()*256);
    return ran;
}
writeDocument("rgb (" + color() + "," +color() + "," + color() +")");
writeDocument("");
console 命令行工具 X clear

                    
>
console