Check if variable is nil?
- nil
- nil?
x = "hello"
puts x.nil?
y = nil
puts y.nil?
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
x = "hello"
puts x.nil?
y = nil
puts y.nil?