if false or true
then puts ‘then’ #----> output is ‘then’. OR gets evaluated!
else puts ‘else’
end
What’s the reason? Thanks for all the help, in advance.
ZT
for the if statement it gets evaluated so it is true and “then” is
evaluated.
for puts flase or ture, I tried it. I got the same result of yours.
However, I tried puts false and true. The output was false. I am not
sure about this one.
I tried this and it gave me true
puts “#{false or true}”
It gets evaluated.
Thanks
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.