Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

indexes-of

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

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
  • Source
  • npm
  • Socket score

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc