Two Ampersands Between Function Calls

前端 未结 4 1448
暖寄归人
暖寄归人 2020-12-21 04:04

What do two ampersands separating function calls do? Note: this is OUTSIDE any if statement or case statement

Like so:

functionCallOne() && f         


        
4条回答
  •  南笙
    南笙 (楼主)
    2020-12-21 04:48

    That is the short-circuit AND operator, meaning the second function (or expression/statement) will only be evaluated if the first returns true.

提交回复
热议问题