Skip to content

Instantly share code, notes, and snippets.

@hawx1993
Last active June 25, 2016 11:30
Show Gist options
  • Save hawx1993/fe4ebd0c08246b0bd98b53c32c87186a to your computer and use it in GitHub Desktop.
Save hawx1993/fe4ebd0c08246b0bd98b53c32c87186a to your computer and use it in GitHub Desktop.
//bind
function bind(fn, ctx) {
return function (a) {
var l = arguments.length;
return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);
};
}
//entend
function extend(destination, source) {
for (var property in source) destination[property] = source[property];
return destination;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment