indexes-of

1.0.1 • Public • Published

indexes-of

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

var indexesOf = require('indexes-of')
 
var twosIndexes = indexesOf([1, 2, 3, 4, 5, 4, 3, 2, 1], 2)
 
console.log(twosIndexes)
 
// [1, 7]
 

Haiku

  • A 5 line module.
  • But the tests are 40 lines.
  • npm publish.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    4,575,387
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    4,575,387
  • 1.0.0
    17

Package Sidebar

Install

npm i indexes-of

Weekly Downloads

4,575,404

Version

1.0.1

License

MIT

Last publish

Collaborators

  • nopersonsmodules