DEV Community

Discussion on: JavaScript: Logical operators and Boolean Values

Collapse
 
merudo profile image
Guillaume F.

Yes!

As a reminder, the logical operators work the following way with non-boolean values:

expr1 && expr2: If expr1 is truthy, returns expr2; else, returns expr1.
expr1 || expr2: If expr1 is truthy, returns expr1; else, returns expr2.