SOURCE

var a=1;
var b=2;
var c;
if(a>b){
    document.write("a>b" + "<br/>");
}

if(a>b){
    document.write("a>b" + "<br/>");
}
else{
    document.write("b>=a" + "<br/>");
}

if(a>b){
    document.write("a>b" + "<br/>");
}
else if(a==b){
    document.write("a=b" + "<br/>");
}
else{
    document.write("b>a" + "<br/>");
}

if (a>b) {
    if (b>a) {
        document.write("错误" + "<br/>");
    }
    else {
        document.write("a > b" + "<br/>");
    }
}
else {
    if (b>a) {
        document.write("b>a" +  "<br/>");
    }
    else {
         document.write("a=b" + "<br/>");
    }
}

switch (1) {
    case 1: 
    {
        document.write(1 + "<br/>");
    }
    case 2: 
    {
        document.write(2 + "<br/>");
    }
    break;
    case 3:
    {
        document.write(3 + "<br/>");
    }
    break;
    default:
    {
        document.write("default <br/>");
    }

}

//判断是不是小数
function xs(num) {
    if (parseInt(num) == parseFloat(num)) {
        document.write(num + "不是小数" + "<br/>");
    }
    else {
        document.write(num + " 是小数" + "<br/>");
    }
}
xs(15);
xs(15.15);
console 命令行工具 X clear

                    
>
console