Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
array.prototype.find
Advanced tools
Simple ES6 Array.prototype.find polyfill for older environments taken from es6-shim.
For browsers and node.js.
npm install array.prototype.find
Array.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; }) // 10
Tests, fixes, and travis support added by _duncanhall
The MIT License (c) 2016 Paul Miller (http://paulmillr.com)
v2.2.2 - 2023-08-27
auto-changelog
90ef840
es-abstract
c83a92f
@es-shims/api
, @ljharb/eslint-config
, aud
, tape
4f76839
@ljharb/eslint-config
, @es-shims/api
, aud
, tape
1997871
define-properties
, es-abstract
28eb0a6
dba046f
574c8fd
FAQs
Array.prototype.find ES6 polyfill.
The npm package array.prototype.find receives a total of 1,775,316 weekly downloads. As such, array.prototype.find popularity was classified as popular.
We found that array.prototype.find demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.