Logs the name of a function.

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)