Last active
September 25, 2017 03:40
-
-
Save arthyn/22ec871a62a05d5acdfdeb2f430f1580 to your computer and use it in GitHub Desktop.
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 | |
* Runs callback with debugger initiated | |
* | |
* Params: | |
* callback - the function you want to debug | |
* args - the array of arguments being passed to the callback | |
* Return: | |
* result of callback | |
*/ | |
function runWithDebugger(callback, args) { | |
debugger; | |
return callback.apply(this, args); | |
} | |
//Simple test: | |
function sayFullName(first, last) { | |
console.log(first + ' ' + last); | |
} | |
runWithDebugger(sayFullName, ['gordon', 'zhu']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment