Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
Created April 24, 2014 16:32
Show Gist options
  • Save ryanflorence/11260824 to your computer and use it in GitHub Desktop.
Save ryanflorence/11260824 to your computer and use it in GitHub Desktop.
function (childName) {
var method;
return function fn() {
if (!method) {
for (var key in this) {
if (this[key] === fn) {
method = key;
break;
}
}
}
return this[child][method].apply(this[child], arguments);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment