🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indexes-of

line String/Array#indexOf but return all the indexes in an array

1.0.1
latest
Version published
Maintainers
1
Created

What is indexes-of?

The npm package 'indexes-of' is a utility that allows you to find all the indexes of a value within an array. It is a simple and focused package that provides a straightforward method for this specific task.

What are indexes-of's main functionalities?

Find indexes of a value in an array

This feature allows you to find all occurrences of a specific value within an array and returns an array of their indexes. In the code sample, it finds all indexes of the value '2' in the array.

const indexesOf = require('indexes-of');
const arr = [1, 2, 3, 2, 4];
const indexes = indexesOf(arr, 2); // returns [1, 3]

Other packages similar to indexes-of

FAQs

Package last updated on 17 Nov 2013

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