13.13 Binary Logical Operators
Syntax
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.
13.13.1 Runtime Semantics: Evaluation
- Let lref be ?
Evaluation ofLogicalANDExpression . - Let lval be ?
GetValue (lref). - Let lbool be
ToBoolean (lval). - If lbool is
false , return lval. - Let rref be ?
Evaluation ofBitwiseORExpression . - Return ?
GetValue (rref).
- Let lref be ?
Evaluation ofLogicalORExpression . - Let lval be ?
GetValue (lref). - Let lbool be
ToBoolean (lval). - If lbool is
true , return lval. - Let rref be ?
Evaluation ofLogicalANDExpression . - Return ?
GetValue (rref).
- Let lref be ?
Evaluation ofCoalesceExpressionHead . - Let lval be ?
GetValue (lref). - If lval is either
undefined ornull , then- Let rref be ?
Evaluation ofBitwiseORExpression . - Return ?
GetValue (rref).
- Let rref be ?
- Else,
- Return lval.