3 ms·
While we're at it... this piece of ruby is about operator precedences. Not strictly in the truthy falsey department but still slightly in topic. The participant
by route66 16y ago
While we're at it... this piece of ruby is about operator precedences. Not strictly in the truthy falsey department but still slightly in topic.
The participants are 1, nil, or, ||, assignment and puts ...
puts (i = nil || 1) => 1
puts i => 1
puts (i = nil or 1) => 1
puts i => nil
puts i = nil || 1 => 1
puts i => 1
puts i = nil or 1 => nil
puts i => nil