if语句
var a =1;
var b =2;
if(a>b){
console.log(a);
}else{
console.log(b);
}
//if/else if
if(a>b){
}else if(){
}else if(){
}
//嵌套if
if(){
if(){
}
}else if(){
}else{
}
switch 语句
var name="sss";
switch(name){
case "tom":console.log(name);break;
case "jim":console.log(name);break;
case "ji":console.log(name);break;
case "tai":console.log(name);break;
default:console.log("没有此人");
}
标签:语句,case,console,log,else,break,switch,name
From: https://www.cnblogs.com/wslxs/p/17307117.html