What do two ampersands separating function calls do? Note: this is OUTSIDE any if statement or case statement
Like so:
functionCallOne() && functionCallTwo();
it is equivalent to
if ( functionCallOne() ) {
functionCallTwo();
}
it just uses the short circuiting to make this 3 liner only take up one line
That is the short-circuit AND operator, meaning the second function (or expression/statement) will only be evaluated if the first returns true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With