Initial commit
[yaffs-website] / node_modules / find-index / README.md
1
2 # find-index
3
4 finds an item in an array matching a predicate function,
5 and returns its index
6
7 fast both when `thisArg` is used and also when it isn't: [jsPerf](http://jsperf.com/array-prototype-findindex-shims)
8
9 ### usage
10 ```bash
11 npm install find-index
12 ```
13 ```js
14 findIndex = require('find-index')
15 findLastIndex = require('find-index/last')
16 ```
17     findIndex(array, callback[, thisArg])
18     findLastIndex(array, callback[, thisArg])
19     Parameters:
20       array
21         The array to operate on.
22       callback
23         Function to execute on each value in the array, taking three arguments:
24           element
25             The current element being processed in the array.
26           index
27             The index of the current element being processed in the array.
28           array
29             The array findIndex was called upon.
30       thisArg
31         Object to use as this when executing callback.
32
33 based on [array-findindex](https://www.npmjs.org/package/array-findindex)