Created
September 28, 2018 04:57
-
-
Save razzius/c69149d66df702266af78bb6132a95e1 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 toTest(a, b) { | |
return a + b | |
} | |
function debug(fn) { | |
return function() { | |
console.log(`Going to call ${fn.name} with ${[].slice.call(arguments).join(', ')}`) | |
result = fn.apply(this, arguments) | |
console.log(`Got result from ${fn.name} of`, result); | |
return result | |
} | |
} | |
debug(toTest)(1,2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment