SOURCE

 //最大值与最小值
 var a = Math.max(0, 2, 6, 143, 350, 1121);
        var b = Math.min(0, 2, 6, 143, 350, 1121);
        document.write("最大值为:" + a + "<br/>");
        document.write("最小值为:" + b+ "<br/>");

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

//生成随机颜色值
 var r = Math.floor(Math.random() * 256);
 var g = Math.floor(Math.random() * 256);
 var b = Math.floor(Math.random() * 256);
 var rgb = "rgb(" + r + "," + g + "," + b + ")";
 document.write(rgb);
console 命令行工具 X clear

                    
>
console