2.2.3 • Published 3 months ago

array.prototype.find v2.2.3

Weekly downloads
2,754,537
License
MIT
Repository
github
Last release
3 months 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-1165git-releasegit-log-to-erratajust-login-bypasslocorobolocorobo-communicatorlogentries-apilavas-corele-playerlocal-xmlhttprequesthock-n-ramlhubot-invite-slackintl-fallback-symboljkfjser-statjson-api-storeimjsnext-build-toolsnextcaltrainnetflix-migrateno-thanks-predictorsno-thanks-explorerno-thanks-learnerno-thanks-runnernode-exports-info@soyjak/utils@reagentum/front-coreyyuap-formatszaibot-eslint-plugin-reactwarning-componentxronos-calendarpostcss-hidepostcss-imperialpolyfiller-catalogpostcss-russian-unitsplaylist-combinatorsurveymanoffline-news-apirange-finderrawblockreact-component-variationsreact-rect-progressbarremix-demoslack-boomsonar-frameworkscroll-hintsimple-event-emittersequelize-data-synctianditutypescript-umluhnoxi-music-webuhnoxi-music-web-build@fintory/flow-coverage-report@mahpooya/airbnb-prop-types@mrporter/mrp-locale-middleware@infinitebrahmanuniverse/nolb-array_@kmwork/front-core@ddn/peer@denistex/extra-prop-types@cschleiden/azure-devops-ui@canimmunize/cvc-js@cumulusds/flow-coverage-report@d-cat/polyfill@nicolo-ribaudo/babel-runtime-es-shims@kentcdodds/eslint-plugin-reactanimachinealpinist@wearebert/coreadda-helperazure-devops-uiazure-devops-ui-previewbrowser-polyfillscerebellumcf-ponychunked-uploaderbackpaxbitbucket-slack-pr-hookblinkloader-ui-componentsbmi-calcconarcouchdb-modelcvc-explorerdigital-motors-web-clientfme-calendarflow-coverage-reporteslint-plugin-react-epeslint-plugin-react-zaiboteslint-plugin-react0eslint-plugin-reactzaiboteslint-import-resolver-webpackexpress-router-controllergenerator-yoga
2.2.3

3 months ago

2.2.2

10 months ago

2.2.1

2 years 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