From: "Xavier R." Date: 2013-02-23T06:32:27+09:00 Subject: Re: Not able to understand the difference between "||=" and "|=". Justin Collins wrote in post #1098508: > On 02/22/2013 01:08 PM, Xavier R. wrote: >> Couldn't reach to any summary. How does it work? >> > > https://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Operators#1._Assignment > > http://lesseverything.com/blog/archives/2008/12/16/guarded-assignment-in-ruby/ from your reference - x &&= x.next_node #=> nil : x will be set to x.next_node, but only if x is NOT nil or false. then how the below works? >> a = [] => [] >> a &&= [2,3] => [2, 3] >> -- Posted via http://www.ruby-forum.com/.