Closed rtorr closed 9 years ago
any thoughts on this method from @AmpersandJS/core-team ?
I like it. It's simple but there are often times in code when I want to express that I'm trying to do something different than extending an existing object. I'm a fan of this over extend({}, obj, obj1)
since it's being more explicit.
+1
@lukekarrys that is exactly our use case at work. We have parts of our code that we always want "merge". It betters the chance of being more clear and not leaving room for the mistake of leaving out the first object. We already implemented this in our project, and thought it might be useful.
agreed, i like to too, let's do it.
@mattwondra also inspired this.
This merge function will give an easy way to combine objects, like extend, but will return a new object, rather than change the
destinationObject
.