Rubyのほとんどのオブジェクトは真なので ! を付けると偽になるよ。
> !0
=> false
> !1
=> false
偽のオブジェクトは真になるよ。
> !false
=> true
> !nil
=> true
Rubyのほとんどのオブジェクトは真なので ! を付けると偽になるよ。
> !0
=> false
> !1
=> false
偽のオブジェクトは真になるよ。
> !false
=> true
> !nil
=> true
If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.zunda.ninja/users/zundan/statuses/115227524476315809 on your instance and quote it. (Note that quoting is not supported in Mastodon.)