2013-11-07から1日間の記事一覧

rubyのand と &&、or と ||

rubyのandと&&は同じだと勘違いしていたので覚え書き and と &&は一緒なんだけど演算子の優先度が違う Ruby リファレンス なので以下のようになる p true and false # => true p true && false # => false 上の式は (p true) and false となりfalseのほうは…