nil in Ruby
'nil || false' returns false and 'false || nil' returns nil.
In ruby both nil and false are evaluated as false value. So the right hand side value is been returned.
Written by Deepak HB
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#