Re:Why 1 && 2 == 2
by codyb on Friday July 19, 2013 @12:28AM
(#6068335)
Worth it for the memoization (I guess that's not really a word?) in Ruby. Cool new operator I did not know about.
[ Parent
| on HN ]
It's not a new operator, but rather the X= form, where `foo X= 4` is sugar for `foo = foo X 4`
Just be careful with this in JavaScript, as the greater number of things that are falsy can bite you if you do `a = a || 10;`, which is a very common JS bug.