Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是什么!!在这个 Ruby 函数中是什么意思?
def is_i? !!(self =~ /^[-+]?[0-9]+$/) end
它确保响应是布尔值。So nilor falsewill become false, 任何其他值都变成true
nil
false
true