So for anyone wondering, a good place to find the answer is here: https://github.com/jashkenas/underscore/search?q=extendOwn&type=Issues&utf8=%E2%9C%93
Update
For anyone interested, the answer is that extendOwn
is synonymous with Object.assign
with the implementation being a tiny bit different. Underscorejs simply is adding an alternative to it. Rather than overriding assign
with a new implementation into Underscorejs and calling it _.assign
, they are calling it _.extendOwn
(with _.assign
being an alias to _.extendOwn
).
The reason for this naming convention is understandable, but imho a bit confusing. You see, Object.assign
is ES6's official name for the method/logic we know as "extend" (as called by tools such as jQuery and Underscore).
The decision by the Underscore team was that they decided on calling the primary/parent method extendOwn
to adhere to their own internal standards. Naming the primary method _.assign
would be (to the Underscore's team) counter intuitive as to them, it confuses what "extend" does. By calling it extendOwn
, they are saying that this method does the same thing as "extend" but is based on the ES6's implementation of this functionality known as "assign".
Essentially - what they had here was a paradox, and they needed to make a decision. Either they stick with the convention we know as "extend" or they allow "assign" - which would just conflict with that original name (which might also begin to cause people to question why they would still call the other method "extend" rather than assignSomethinghere
instead).
Long story short - extendOwn
is the Underscore version of ES6's Object.assign
. They just named it extendOwn
to keep it in alignment with and the same naming convention, which is named extend.