package
Array.prototype.find ES6 polyfill.
npm install array.prototype.findGitHub-flavored package documentation.
Across all versions, last 30 days.
7,135,549 in 30 days
Runtime metadata.
Tagged topics.
Simple ES6 Array.prototype.find polyfill for older environments taken from es6-shim.
For browsers and node.js.
npm install array.prototype.findArray.prototype.find(predicate[, thisArg]) returns first item that matches predicate function.predicate(value, index, collection): takes three arguments
value: current collection elementindex: current collection element indexcollection: the collection// as a function
var find = require('array.prototype.find');
find([1, 2], function (x) { return x === 2; }); // 2
// to shim it
require('array.prototype.find').shim();Code example:
// Default:
[1, 5, 10, 15].find(function (a) { return a > 9; }) // 10Tests, fixes, and travis support added by _duncanhall
The MIT License (c) 2016 Paul Miller (http://paulmillr.com)
ljharb
ljharb@gmail.com
Estimated unpacked size across 60 packages.
3.9 MB+
Includes dependencies.
5 direct dependencies.
^1.0.7
1.0.9
^1.23.2
1.24.2
^1.0.0
1.1.2
^1.2.1
1.2.1
^1.0.2
1.1.0