SOURCE

var a=2;
if(a%2==0){
    console.log(a);
}

var a=10;
if(a>5){
    console.log("a比5大");
}

var b=13;
if(b>15){
    console.log("b比15大");
}
else
{
    console.log("b比15小");
}

var book="maths";
if(book=="history"){
    console.log("History book");
}
else if(book=="maths"){
    console.log("Maths book");
}
else if(book=="economics"){
    console.log("Economics book");
}
else{
    console.log("Unknown book");
}


var grade='A';//评分等级
console.log("进入switch语句")
switch (grade){
case 'A':
console.log("供应商的评分为A");
break;
case 'B':
console.log("供应商评分为B");
break;
case 'C':
console.log("供应商评分为C");
break;
case "D":
console.log("供应商评分为D");
break;
case 'F':
console.log("供应商的评分为F,不及格,不建议继续合作");
break;
default:
console.log("供应商的评分未知,为其他值")
}
console.log("swith语句完毕!")
console 命令行工具 X clear

                    
>
console