DEV Community

Discussion on: Why is it you can execute a function on the right side of an AND && operator in JavaScript

Collapse
 
michael profile image
Michael Lee 🍕

This totally looks like it could be by design of JavaScript.

262.ecma-international.org/12.0/#s...

Where in that:

The value produced by a && or || operator is not necessarily of type Boolean. The value produced will always be the value of one of the two operand expressions.