Fix findLast docs code

This commit is contained in:
Siarhei
2018-05-11 16:18:35 +04:00
parent 656b0492d6
commit 2e122516cd

View File

@ -5,7 +5,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.pop()` 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 ```js
const findLast = (arr, fn) => arr.filter(fn).slice(-1)[0]; const findLast = (arr, fn) => arr.filter(fn).pop();
``` ```
```js ```js