From: "Xavier R." Date: 2013-02-23T05:45:35+09:00 Subject: Re: Not able to understand the difference between "||=" and "|=". Huum,, Interesting from the below code I got the taste : >> a = [2,3,4] => [2, 3, 4] >> a||=[2,1,4,6] >> b ||= [2,33] => [2, 33] >> b ||= [21,33] => [2, 33] From the above code it is clear that "||=" operators set the variable conditionally. Condition is like that if the variable is set to "false or nil" then set it or return it's already set value. => [2, 3, 4] >> a |= [2,1,4,6] => [2, 3, 4, 1, 6] >> a = [1,2,3] => [1, 2, 3] >> a |= [4,5] => [1, 2, 3, 4, 5] >> a |= [4,5,6] => [1, 2, 3, 4, 5, 6] >> From the above code I can say that "|=" operator performing kind of concatenation and if delicates then remove it away. If any wrong logic I said here, forgive me and correct me please. -- Posted via http://www.ruby-forum.com/.