Travis build: 867

This commit is contained in:
30secondsofcode
2018-12-07 16:18:45 +00:00
parent 30bf68983c
commit 400c1ae1ad
20 changed files with 58 additions and 31 deletions

View File

@@ -4,10 +4,10 @@ Filters out the falsy values in an array.
Use `Array.prototype.filter()` to get an array containing only truthy values.
```js
```js
const filterFalsy = arr => arr.filter(Boolean);
```
```js
```js
filterFalsy(['', true, {}, false, 'sample', 1, 0]); // [true, {}, 'sample', 1]
```

View File

@@ -17,7 +17,7 @@ const sum = pipeAsyncFunctions(
x => x + 3,
async x => (await x) + 4
);
(async () => {
(async() => {
console.log(await sum(5)); // 15 (after one second)
})();
```

View File

@@ -9,9 +9,9 @@ The `func` is invoked with three arguments (`value, index, array`).
const remove = (arr, func) =>
Array.isArray(arr)
? arr.filter(func).reduce((acc, val) => {
arr.splice(arr.indexOf(val), 1);
return acc.concat(val);
}, [])
arr.splice(arr.indexOf(val), 1);
return acc.concat(val);
}, [])
: [];
```