Ruby does not have an "defined-or" operator! The ||= evaluates the right side even when the left side is defined and false. Example:
||=
irb(main):001:0> foo = false => false irb(main):002:0> foo => false irb(main):003:0> foo ||= true => true irb(main):004:0> foo => true
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Ruby does not have an "defined-or" operator! The
||=
evaluates the right side even when the left side is defined and false. Example: