我是靠谱客的博主 鳗鱼大树,这篇文章主要介绍ruby三元操作符_Ruby中的三元(有条件的)运算符是什么?,现在分享给大家,希望可以做个参考。

ruby三元操作符

The ternary (or conditional) operator will evaluate an expression and return one value if it's true, and another value if it's false. It's a bit like a shorthand, compact if statement.

三元运算符(或条件运算符)将对表达式求值,如果为true,则返回一个值,如果为false,则返回另一个值。 这有点像速记,紧凑的if语句。

Ruby's ternary operator has its uses but it's also a bit controversial.

最后

以上就是鳗鱼大树最近收集整理的关于ruby三元操作符_Ruby中的三元(有条件的)运算符是什么?的全部内容,更多相关ruby三元操作符_Ruby中内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(102)

评论列表共有 0 条评论

立即
投稿
返回
顶部