Update reducedFilter.md

This commit is contained in:
Angelos Chalaris
2018-01-01 17:05:25 +02:00
committed by GitHub
parent 8b397fc019
commit a1daf2e695

View File

@ -2,8 +2,8 @@
Filter an array of objects based on a condition while also filtering out unspecified keys.
Use `Array.filter()` to filter the array based on the predicate `fn` so that it returns the objects for
which the condition returned a truthy value. On the filtered array, use `Array.map()` to return the new object using `Array.reduce()` to filter out the keys which were not supplied as the `keys` argument.
Use `Array.filter()` to filter the array based on the predicate `fn` so that it returns the objects for which the condition returned a truthy value.
On the filtered array, use `Array.map()` to return the new object using `Array.reduce()` to filter out the keys which were not supplied as the `keys` argument.
```js
const reducedFilter = (data, keys, fn) =>