Skip to content

Instantly share code, notes, and snippets.

@naf03
Created April 7, 2019 05:37
Show Gist options
  • Save naf03/758cb2ee3d8ba652e24d881048ced8b6 to your computer and use it in GitHub Desktop.
Save naf03/758cb2ee3d8ba652e24d881048ced8b6 to your computer and use it in GitHub Desktop.
Improved runWithDebugger function
function runWithDebugger(callback, optionalArgs){
//check optionalArgs is undefined
if (optionalArgs===undefined){
debugger;
callback();
}
else if ( Object.getPrototypeOf(optionalArgs)===Array.prototype ){
debugger;
callback.apply(null, optionalArgs);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment