+ 3
Ruby - Why is output 2 and not 3?
x = 0 y = 1 puts x == y ? y : (x ? 2 : 3) I expect: x is different from y, so instead of putting out y, expression in parentheses is evaluated; since x is 0, 3 should be outputted. Why is 2 instead?
1 Réponse
+ 4
In ruby zero value is not false like c++ for example.