What evaluates to false in Ruby?

前端 未结 4 1547
逝去的感伤
逝去的感伤 2020-11-30 13:37

false and nil evaluate to false in Ruby. Anything else? Please provide links to official/authoritative references.

4条回答
  •  执笔经年
    2020-11-30 14:31

    I can only agree, that nil and false are indeed the only two values, that evaluate to false in Ruby. I just wanted to point to another useful resource:

    True and False vs. "Truthy" and "Falsey" (or "Falsy") in Ruby, Python, and JavaScript

提交回复
热议问题