You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

find-item

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-item

A utility package to find an item that matches a condition from an array

1.0.0
latest
Source
npm
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

find-item

A utility package to find an item that matches a condition from an array.

Search Algorithms

find-item currently only supports 2 search algorithms:

Linear

Linear can be called like this: findItem.linear(array here, function to check if matches condition here, get all matches or the first, "all", "first"). If you choose the all option, it will return an array, which will contain the indexes of the values that match the condition. If no values are found, an empty array will be given. If you choose the first option, it will return a single number which is the index of the first value found. If no values are found, -1 will be returned.

Binary

Binary can be called like this: findItem.binary(array here, number here). This will return the index of location of the number. If it is not found, it will return -1.

Keywords

array

FAQs

Package last updated on 25 Jul 2020

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