From: Robert Klemme Date: 2013-02-23T18:45:12+09:00 Subject: Re: Not able to understand the difference between "||=" and "|=". On Fri, Feb 22, 2013 at 11:51 PM, Xavier R. wrote: > Hans Mackowiak wrote in post #1098517: >> [] is not nil or false >> >> if [] >> p "like true" >> else >> p "like false" >> end >> >> >> guess what this lines will output? > > got the point. Could you give me a valid example of "&&=" ? I think I have something even better: advice how to find out yourself. Fire up IRB and then start experimenting. It's best to start from simple expressions, so first for different combinations of a and b do a && b Look at the result. Then do a &&= b a ||= b Reason about what you see. If unsure, do more tests. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/