How does nil? work in ruby?
ruby
Solution
Simple answer: `()` is an empty expression that evaluates to `nil`.
More detailed: all expressions have a result in Ruby, returning `nil` if there's nothing better to return. `()` doesn't cause any action by itself, so an expression that is merely `()` has nothing in particular to return. Thus the result of the expression is set to `nil`, and so `().nil?` evaluates an empty expression, decides there's nothing much to return so returns `nil`. This is indeed equal to `nil`, so `nil?` says `true`.
Problem
How come ().nil? is true in Ruby?