Fix findLast snippet docs

This commit is contained in:
Siarhei
2018-05-11 16:10:15 +04:00
parent 06c616b75c
commit 656b0492d6

View File

@ -2,7 +2,7 @@
Returns the last element for which the provided function returns a truthy value.
Use `Array.filter()` to remove elements for which `fn` returns falsey values, `Array.slice(-1)` to get the last one.
Use `Array.filter()` to remove elements for which `fn` returns falsey values, `Array.pop()` to get the last one.
```js
const findLast = (arr, fn) => arr.filter(fn).slice(-1)[0];