Appearance
三种常用判断
if
javascriptif () { // ... } else if () { // ... } else () { // ... }三元运算符
javascriptx > 1 ? y++ : null // 为假时什么都不做 x = y > 1 ? 1 : null // 为假时将 null 赋值给 xswitch
javascriptswitch (x) { // 基于 === 比较 case 1: x += 1 break case 2: x += 2 break default: x += 3 }