-   Notifications  You must be signed in to change notification settings 
- Fork 132
Closed
Labels
Description
Section 1.1.6 says (paraphrasing) that e1 && e2 is syntactic sugar for e1 ? e2 : false, and e1 || e2 is syntactic sugar for e1 ? true : e2. Strictly speaking, in JavaScript, e1 && e2 is syntactic sugar for e1 ? e2 : e1 and e1 || e2 is syntactic sugar for e1 ? e1 : e2.
Direct link to the relevant portion of the language specification: https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-binary-logical-operators-runtime-semantics-evaluation