//条件语句 if (false) { console.log("is true") } else { console.log("is false") } //条件语句2 switch(name){ case "123name": console.log("1") case 2: console.log("2") break; case 3: console.log("3") default: console.log("4") } //条件语句3 var name = "123name"; //定义变量 for (var i = name.length; i >= 0; i--) { //name.length 获取字符串长度 console.log("name idx:" + i) //字符串拼接 } //条件语句4 do{ console.log(" while function") }while(false) //条件语句5 var nCount = 1 while(nCount > 0){ console.log("print :" + nCount) nCount--; }