With the ternary operator, the assignment always happens. It is only what is assigned that varies.
Thus, on each iteration of the first for loop, all 3 hash values are assigned, but only one can be set to 1.
In the second for loop, only one hash value is assigned during each pass.
In reply to Re: Ternary operators
by BrowserUk
in thread Ternary operators
by geistberg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |