title: underscorejs - what is the difference between extendOwn vs extend?
body: <p>While going through <a href="http://underscorejs.org" rel="noreferrer">underscorejs</a>'s list of methods, I couldn't help but notice a method which I don't remember being there before: <a href="http://underscorejs.org/#extendOwn" rel="noreferrer">extendOwn</a></p>
  
  <p>The <a href="http://underscorejs.org/#extendOwn" rel="noreferrer">documentation for this method</a> says the following:</p>
  
  <blockquote>
    <p><strong>extendOwn</strong> _.extendOwn(destination, *sources) <em>Alias</em>: <strong>assign</strong></p>
    
    <p>Like extend, but only copies <em>own</em> properties over to the destination object.</p>
  </blockquote>
  
  <p>I understand how <a href="http://underscorejs.org/#extend" rel="noreferrer"><em>.extend()</a> is used and what it does... but for the life of me I cannot understand how it differs from <a href="http://underscorejs.org/#extendOwn" rel="noreferrer"></em>.extendOwn()</a>.</p>
  
  <p>I tried using <a href="http://underscorejs.org/#extend" rel="noreferrer"><em>.extend()</a> and then <a href="http://underscorejs.org/#extendOwn" rel="noreferrer"></em>.extendOwn()</a> to extend a few objects just to see if maybe there was something obvious that would happen - but they seem to both produce the same result.</p>
  
  <pre><code>var a = {
      foo: false
  };
  
  var b = {
      bar: true
  };
  
  // This will produce { foo: false, bar: true }; ..just like _.extend() would =\
  _.extendOwn( a, b );
  </code></pre>
  
  <p>Any insight into this mystery would be greatly appreciated!</p>