Created
April 7, 2019 05:37
-
-
Save naf03/758cb2ee3d8ba652e24d881048ced8b6 to your computer and use it in GitHub Desktop.
Improved runWithDebugger function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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