当条件为 true 时,执行某些操作,我们可能会这样写:
if(condition){
toto()
}
这种方式可以用 && 简写:
condition && toto()
&& 当前面的判断值屎真的时候,就执行后面,如果为假就不执行了
当条件为 true 时,执行某些操作,我们可能会这样写:
if(condition){
toto()
}
这种方式可以用 && 简写:
condition && toto()
&& 当前面的判断值屎真的时候,就执行后面,如果为假就不执行了