diff --git a/snippets/pipeLog.md b/snippets/pipeLog.md new file mode 100644 index 000000000..d28dfafdf --- /dev/null +++ b/snippets/pipeLog.md @@ -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` +```