易百教程

14、Ruby if-else 语句作用是什么?

Ruby if-else 语句用于测试条件。Ruby 中有多种类型的语句。

  • if 语句
  • if-else 语句
  • if-else-if (elsif) 语句
  • 三元语句