Last active
June 3, 2016 00:59
-
-
Save guilipan/c0c3b9ba9ebd58fd6a5e to your computer and use it in GitHub Desktop.
ES5下实现mixin或extend的方法
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 (receiver, supplier) { | |
Object.keys(supplier).forEach(function (property) { | |
Object.defineProperty(receiver, property, Object.getOwnPropertyDescriptor(supplier, property)); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment