Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4622

What is the difference between '&&' and '&' in Ruby

$
0
0

Recently, I observed a very interesting result in Ruby while making use of && and & for the input combination of 0 & 1.

I want to understand the below output with respect to the above mentioned two operators. This is implemented using Ruby 2.0.0-p451

2.0.0-p451 :006 > 0 && 1 => 1 2.0.0-p451 :008 > 0 & 1 => 0 

Viewing all articles
Browse latest Browse all 4622


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>