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 the result of evaluating
LogicalANDExpression . - Let lval be ?
GetValue (lref). - Let lbool be !
ToBoolean (lval). - If lbool is
false , return lval. - Let rref be the result of evaluating
BitwiseORExpression . - Return ?
GetValue (rref).
- Let lref be the result of evaluating
LogicalORExpression . - Let lval be ?
GetValue (lref). - Let lbool be !
ToBoolean (lval). - If lbool is
true , return lval. - Let rref be the result of evaluating
LogicalANDExpression . - Return ?
GetValue (rref).
- Let lref be the result of evaluating
CoalesceExpressionHead . - Let lval be ?
GetValue (lref). - If lval is
undefined ornull , then- Let rref be the result of evaluating
BitwiseORExpression . - Return ?
GetValue (rref).
- Let rref be the result of evaluating
- Otherwise, return lval.