Ruby逻辑运算符 [英] Ruby logical operators

查看:82
本文介绍了Ruby逻辑运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
“ and”和“或Ruby中的运算符?

Possible Duplicate:
Is there any wisdom behind “and”, “or” operators in Ruby ?

以下几对逻辑运算符之间有什么区别?

What is the difference, if any, between the following pairs of logical operators?

  1. &&与和
  2. ||与.或

推荐答案

单词"版本的优先级低于符号"版本的优先级.实际上,它们的优先级甚至低于分配.

The "word" versions have lower precedence than the "symbol" versions. In fact, they have even lower precedence than assignment.

这篇关于Ruby逻辑运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆