diff --git a/snippets/pipeLog.md b/snippets/pipeLog.md deleted file mode 100644 index c106398b0..000000000 --- a/snippets/pipeLog.md +++ /dev/null @@ -1,13 +0,0 @@ -### 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` -``` diff --git a/snippets_archive/pipeLog.md b/snippets_archive/pipeLog.md new file mode 100644 index 000000000..972776b1f --- /dev/null +++ b/snippets_archive/pipeLog.md @@ -0,0 +1,15 @@ +### pipeLog + +Logs a value and returns it. + +Use `console.log` to log the supplied value, combined with the `||` operator to return it. + + + +```js +const pipeLog = data => console.log(data) || data; +``` + +```js +pipeLog(1); // logs `1` and returns `1` +```