Regarding the ternary (? :
) operator in JavaScript, I would like to know how it is evaluated by a typical browser\'s JavaScript interpreter:
Alternative A:<
The ternary operator evaluates lazily for several reasons.
x != 0 ? 10 / x : 10;
If it evaluated everything at the same time you would get a divide by zero error if x were zero