2.2.3 • Published 1 month ago

array.prototype.find v2.2.3

Weekly downloads
2,754,537
License
MIT
Repository
github
Last release
1 month ago

array.prototype.find Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Simple ES6 Array.prototype.find polyfill for older environments taken from es6-shim.

For browsers and node.js.

Installation

  • Just include repo before your scripts.
  • npm install array.prototype.find

Usage

  • Array.prototype.find(predicate[, thisArg]) returns first item that matches predicate function.
  • predicate(value, index, collection): takes three arguments
    • value: current collection element
    • index: current collection element index
    • collection: 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; }) // 10

Acknowledgements

Tests, fixes, and travis support added by _duncanhall

License

The MIT License (c) 2016 Paul Miller (http://paulmillr.com)

airbnb-prop-typesactive-react-scripts@arisageha/react-lazyload@arisageha/react-lazyload-fixglints-sir-trevor@everything-registry/sub-chunk-1165simple-event-emittersequelize-data-syncscroll-hintreact-rect-progressbardigital-motors-web-clientrange-findercvc-explorer@d-cat/polyfill@cschleiden/azure-devops-uirawblockremix-demosonar-framework@ddn/peerslack-boomcf-ponycerebellum@canimmunize/cvc-jschunked-uploaderpolyfiller-catalogplaylist-combinatorpostcss-imperialpostcss-hidepostcss-russian-units@soyjak/utilscouchdb-model@cumulusds/flow-coverage-reportblinkloader-ui-componentsbitbucket-slack-pr-hookbrowser-polyfillsbmi-calcconarreact-component-variations@denistex/extra-prop-typeseslint-import-resolver-webpacksurveymanflow-coverage-reporteslint-plugin-react-epeslint-plugin-react-zaiboteslint-plugin-react0eslint-plugin-reactzaibotexpress-router-controller@fintory/flow-coverage-report@reagentum/front-coreanimachineadda-helperalpinist@wearebert/corebackpaxazure-devops-uiazure-devops-ui-previewfme-calendartianditujkfintl-fallback-symbolgit-log-to-erratagit-releaseuhnoxi-music-webuhnoxi-music-web-buildgenerator-yogatypescript-umljust-login-bypassyyuap-formatsxronos-calendarzaibot-eslint-plugin-reactjson-api-storewarning-componenthubot-invite-slackimjshock-n-ramllavas-core@mahpooya/airbnb-prop-typesnextcaltrainnext-build-toolsnetflix-migratejser-statlocal-xmlhttprequestlocorobolocorobo-communicator@infinitebrahmanuniverse/nolb-array_le-player@kmwork/front-core@kentcdodds/eslint-plugin-reactlogentries-apino-thanks-explorerno-thanks-learnerno-thanks-predictorsno-thanks-runnernode-exports-info@nicolo-ribaudo/babel-runtime-es-shims@mrporter/mrp-locale-middlewareoffline-news-api
2.2.3

1 month ago

2.2.2

8 months ago

2.2.1

1 year ago

2.2.0

2 years ago

2.1.2

3 years ago

2.1.1

4 years ago

2.1.0

5 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

8 years ago

1.0.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago