Skip to content

Instantly share code, notes, and snippets.

@Breefield
Created August 20, 2012 06:24
Show Gist options
  • Save Breefield/3401553 to your computer and use it in GitHub Desktop.
Save Breefield/3401553 to your computer and use it in GitHub Desktop.
Call/Apply
// You wrote this line
Function.prototype.call(current[ev], this, arguments);
// This line does what I want, calling the method on the current tool and passing the arguments.
current[ev].apply(this, arguments);
// Not sure what you were aiming for with the other line?
@junosuarez
Copy link

Caveat that I ran into today: using call/apply on Function.prototype invokes it as expected, but returns undefined.

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