Last active
November 4, 2018 11:24
-
-
Save c3ry5/6055052 to your computer and use it in GitHub Desktop.
Merging two js objects without jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.prototype.assign = Object.assign || function(obj1, obj2) { | |
var obj3 = obj1; | |
for (var attrname in obj2) { | |
if (typeof(obj2[attrname]) !== 'function') { | |
obj3[attrname] = obj2[attrname]; | |
} | |
} | |
return obj3; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment