title: Need a simple explanation of the inject method
body: <pre><code>[1, 2, 3, 4].inject(0) { |result, element| result + element } # =&gt; 10
  </code></pre>
  
  <p>I'm looking at this code but my brain is not registering how the number 10 can become the result. Would someone mind explaining what's happening here?</p>