Last active
May 22, 2019 17:09
-
-
Save ugitch/a294ce3401a60c820e859c5e2b5deb86 to your computer and use it in GitHub Desktop.
Run the function with the debugger
This file contains hidden or 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
// with spread operator | |
function runWithDebugger(callback, argsForCallback) { | |
debugger; | |
if (argsForCallback !== undefined && Array.isArray(argsForCallback)) { | |
return callback(...argsForCallback); | |
} else { | |
return callback(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment