4 ms·
At least for the examples provided in the article true/false behaves like Ruby.
by devin 16y ago
At least for the examples provided in the article true/false behaves like Ruby.
- route66 16y agoWhile 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