Basically, I am trying to check if 6 of my values are the same. I tried stringing them:
if val1 == val2 == val3 == val4 == val5 == val6
#...
end
But this errors out. Is this possible using another method?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try this:
If you wanna get fancy, you can try this
The above will stop as soon as it finds an element that is not equal to
val1, otherwise, the block will be executed.