Created
May 18, 2017 18:41
-
-
Save sergiogarciadev/7752dbc694055d423ea6c5ca0d1f6c6d to your computer and use it in GitHub Desktop.
Mixins in Javascript
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
function extend() { | |
var destination = arguments[0]; | |
for (var i = 1; i < arguments.length; i++) { | |
var source = arguments[i]; | |
for (var k in source) { | |
if (source.hasOwnProperty(k)) { | |
destination[k] = source[k]; | |
} | |
} | |
} | |
return destination; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment