Remove pipeLog
This commit is contained in:
@ -1,16 +0,0 @@
|
||||
---
|
||||
title: pipeLog
|
||||
tags: utility,beginner
|
||||
---
|
||||
|
||||
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`
|
||||
```
|
||||
@ -1,8 +0,0 @@
|
||||
const {pipeLog} = require('./_30s.js');
|
||||
|
||||
test('pipeLog is a Function', () => {
|
||||
expect(pipeLog).toBeInstanceOf(Function);
|
||||
});
|
||||
test('pipeLog returns the given value', () => {
|
||||
expect(pipeLog('hi')).toBe('hi');
|
||||
});
|
||||
Reference in New Issue
Block a user