Files
30-seconds-of-code/snippets/function-name.md
Stefan Feješ b848906fe5 fix naming
2017-12-17 15:41:31 +01:00

292 B

Log function name

Use console.debug() and the name property of the passed method to log the method's name to the debug channel of the console.

const functionName = fn => (console.debug(fn.name), fn);
// functionName(Math.max) -> max (logged in debug channel of console)