Created
April 13, 2020 18:26
-
-
Save razzius/a5f865ac92e1798d3490fae54a429349 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