title: What is Returned in Ruby if the Last Statement Evaluated is an If Statement
body: <p>My understanding is that ruby returns the last statement evaluated in a function.  What if the function ends with an <code>if</code> statement that evaluates to false</p>
  
  <pre><code>def thing(input)
    item = input == "hi"
    if item
      []
    end
  end
  
  puts thing("hi").class #&gt; Array
  puts thing("not hi").class #&gt; NilClass
  </code></pre>
  
  <p>I like this functionality (returning <code>nil</code> if the statement is false), but why isn't <code>false</code> returned (from the assignment to <code>item</code>)?</p>