Snippet format update
To match the starter (for the migration)
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
### findLastIndex
|
||||
---
|
||||
title: findLastIndex
|
||||
tags: array,function,intermediate
|
||||
---
|
||||
|
||||
Returns the index of the last element for which the provided function returns a truthy value.
|
||||
|
||||
@ -17,4 +20,4 @@ const findLastIndex = (arr, fn) =>
|
||||
```js
|
||||
findLastIndex([1, 2, 3, 4], n => n % 2 === 1); // 2 (index of the value 3)
|
||||
findLastIndex([1, 2, 3, 4], n => n === 5); // -1 (default value when not found)
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user