Adding formalism from the language specification to Pointy's answer here.
When you run your code through the conditional (? :) operator the first thing that happens is that
ToBoolean is called on the left hand side.
When you do
ToBoolean is called on the left hand side, and then ToBoolean on that. The spec is clear on this saying:
If ToBoolean(GetValue(lref)) is true, then
Let trueRef be the result of evaluating the first AssignmentExpression.
Let falseRef be the result of evaluating the second AssignmentExpression.