🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

array-find

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-find

ES6 Array.find ponyfill. Return the first array element which satisfies a testing function.

1.0.0
latest
Source
npm
Version published
Weekly downloads
942K
-16.99%
Maintainers
1
Weekly downloads
 
Created

What is array-find?

The array-find npm package provides a simple utility to find the first element in an array that satisfies a provided testing function. It is a lightweight alternative to the native Array.prototype.find method, offering similar functionality.

What are array-find's main functionalities?

Finding an element in an array

This feature allows you to find the first element in an array that satisfies a given condition. In this example, the condition is that the element should be greater than 3.

const find = require('array-find');
const array = [1, 2, 3, 4, 5];
const found = find(array, function(element) {
  return element > 3;
});
console.log(found); // Output: 4

Other packages similar to array-find

Keywords

array

FAQs

Package last updated on 21 May 2015

Did you know?

Socket

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.

Install

Related posts