fin

@arr/findindex

A collection of tiny, highly performant Array.prototype alternatives

Showing:

Popularity

Downloads/wk

64

GitHub Stars

246

Maintenance

Last Commit

1yr ago

Contributors

3

Package

Dependencies

0

Size (min+gzip)

0.2KB

License

MIT

Type Definitions

Built-In

Tree-Shakeable

Yes?

Categories

Readme

@arr/findindex

A tiny, faster alternative to native Array.prototype.findIndex

⚠️ Unlike native, @arr/findindex does not support the optional thisArg parameter!

Install

$ npm install --save @arr/findindex

Usage

import findIndex from '@arr/findindex';

findIndex([12, 5, 8, 130, 44], val => val > 15);
//=> 3

API

findIndex(arr, callback)

arr

Type: Array
The array to iterate upon.

callback(value[, index, array])

Type: Function
Function to test for each element, taking three arguments:

  • value (required) -- The current element being processed in the array.
  • index (optional) -- The index of the current element being processed in the array.
  • array (optional) -- The array findIndex was called upon.

License

MIT © Luke Edwards

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial