title: what is the point of return in Ruby?
body: <p>What is the difference between <code>return</code> and just putting a variable such as the following:</p>
  
  <h3>no return</h3>
  
  <pre><code>def write_code(number_of_errors)
    if number_of_errors &gt; 1
       mood = "Ask me later"
    else
       mood = "No Problem"
    end  
    mood
  end
  </code></pre>
  
  <h3>return</h3>
  
  <pre><code>def write_code(number_of_errors)
    if number_of_errors &gt; 1
      mood =  "Ask me later"
    else
      mood = puts "No Problem"
    end  
    return mood
  end
  </code></pre>