Skip to content

Instantly share code, notes, and snippets.

@guilipan
Last active June 3, 2016 00:59
Show Gist options
  • Save guilipan/c0c3b9ba9ebd58fd6a5e to your computer and use it in GitHub Desktop.
Save guilipan/c0c3b9ba9ebd58fd6a5e to your computer and use it in GitHub Desktop.
ES5下实现mixin或extend的方法
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