Skip to content

Instantly share code, notes, and snippets.

@ETiV
Created May 6, 2013 09:10
Show Gist options
  • Save ETiV/5524145 to your computer and use it in GitHub Desktop.
Save ETiV/5524145 to your computer and use it in GitHub Desktop.
javascript invoke callback
var __callback = function (cb) {
if (typeof cb == 'function') {
delete arguments['0'];
var args = [];
for (var key in arguments) {
if (arguments.hasOwnProperty(key)) {
args.push(arguments[key]);
}
}
cb.apply(null, args);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment