1.逻辑与运算符
bad:
if(isShow){
// todo
}
good:
isShow&&toDo()
2.使用 includes 处理多重条件
if( currentWind === 2 || code === 3 || code === 4 ){
// toDo
}
可以改成
if([2,3,4].includes(currentWind)){
// todo
}
3.使用三元运算
待续
1.逻辑与运算符
bad:
if(isShow){
// todo
}
good:
isShow&&toDo()
2.使用 includes 处理多重条件
if( currentWind === 2 || code === 3 || code === 4 ){
// toDo
}
可以改成
if([2,3,4].includes(currentWind)){
// todo
}
3.使用三元运算
待续