Merge pull request #719 from 3dos/patch-1

[FEATURE] Create pipeLog.md
This commit is contained in:
Angelos Chalaris
2018-09-22 14:37:26 +03:00
committed by GitHub

13
snippets/pipeLog.md Normal file
View File

@ -0,0 +1,13 @@
### pipeLog
Use `console.log` in a pipeline as this function simply encloses it and returns the passed value. This is especially useful for debugging when you want to log a variable's value before its usage.
Logs a value and returns it.
```js
const pipeLog = data => console.log(data) || data
```
```js
pipeLog(1); // logs `1` and returns `1`
```