Way of work is fine, what’s your worry? An advice: use parenthesis, and
try to use && and ||, they have higher presendece than “and” and “or”,
unless you want to nest this operators for some purpose.
Way of work is fine, what’s your worry? An advice: use parenthesis, and
try to use && and ||, they have higher presendece than “and” and “or”,
unless you want to nest this operators for some purpose.
Thanks for your reply and helpful tips.
My question is why “and” in “while” conditions works as either and not
both and
“or” the opposite?
Ex.
"
var1 = 1
var2 = 1
if var1 == 1 and var2 == 1
puts true
else
puts false
end"
^ I tried this and it works correctly the “and” demands both and “or”
demands either.
Is it because “while” doesn’t accept multiple conditions?
Thanks again
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.