Tag and build
This commit is contained in:
8
snippets/log-function-name.md
Normal file
8
snippets/log-function-name.md
Normal file
@ -0,0 +1,8 @@
|
||||
### 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.
|
||||
|
||||
```js
|
||||
const functionName = fn => (console.debug(fn.name), fn);
|
||||
// functionName(Math.max) -> max (logged in debug channel of console)
|
||||
```
|
||||
@ -1,8 +0,0 @@
|
||||
### Log method 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.
|
||||
|
||||
```js
|
||||
const methodName = fn => (console.debug(fn.name), fn);
|
||||
// methodName(methodName) -> methodName (logged in debug channel of console)
|
||||
```
|
||||
Reference in New Issue
Block a user