返回顶部

收藏

unless can work in exactly the same way because unless is just the opposite of if:

更多
age = 10
unless age >= 18
  puts 'You're too young to use this system'
  puts 'So we're going to exit your program now'
  exit
end

标签:Ruby,Statement

收藏

0人收藏

支持

0

反对

0

发表评论