Create pipeLog.md
This commit is contained in:
committed by
GitHub
parent
4a46d1b8ad
commit
85b1602f02
13
snippets/pipeLog.md
Normal file
13
snippets/pipeLog.md
Normal file
@ -0,0 +1,13 @@
|
||||
### pipeLog
|
||||
|
||||
Use `console.log` in a pipeline as this function simply encloses it and returns the passed value.
|
||||
|
||||
Logs a value and returns it.
|
||||
|
||||
```js
|
||||
const pipeLog = data => console.log(data) || data
|
||||
```
|
||||
|
||||
```js
|
||||
pipeLog(1); // logs `1` and returns `1`
|
||||
```
|
||||
Reference in New Issue
Block a user