Skip to content

Instantly share code, notes, and snippets.

@gsnedders
Created April 8, 2013 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsnedders/5340362 to your computer and use it in GitHub Desktop.
Save gsnedders/5340362 to your computer and use it in GitHub Desktop.
[[Call]], in JS
var call = (function() {
var apply = Function.prototype.call.bind(Function.prototype.apply);
apply.call = Function.prototype.call;
return function(func, thisArg, args) {
return apply.call(func, thisArg, args);
}
})();
@mnieper
Copy link

mnieper commented Feb 10, 2015

I don't quite understand your code. Isn't

var call = Function.prototype.call.bind(Function.prototype.apply)

what you want?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment