the array is returning a boolean value instead of the value assigned by the ternary operator
and the code...
arr = []
arr << true == false ? 'a' : 'b'
# Expecting, the output of arr to be ['b']. But instead, I was getting [true]
Why is this behavior?
and to get the right value I have to do this.
arr << if true == false
'a'
else
'b'
end
# and also, = also works fine
arr = true == false ? 'a' : 'b' # arr has 'b'
and why the behavior is different when using the ternary operator?