13.14 Conditional Operator ( ? :
)
Syntax
The grammar for a
13.14.1 Runtime Semantics: Evaluation
- Let lref be ?
Evaluation ofShortCircuitExpression . - Let lval be
ToBoolean (?GetValue (lref)). - If lval is
true , then- Let trueRef be ?
Evaluation of the firstAssignmentExpression . - Return ?
GetValue (trueRef).
- Let trueRef be ?
- Else,
- Let falseRef be ?
Evaluation of the secondAssignmentExpression . - Return ?
GetValue (falseRef).
- Let falseRef be ?