indexes-of
line String/Array#indexOf but return all the indexes in an array
Last updated 13 years ago by dominictarr .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install indexes-of 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.1                                ...           latest (13 years ago)

2 Versions

  • 1.0.1                                ...           13 years ago
  • 1.0.0                                ...           13 years ago
Maintainers (1)
Downloads
Total 16
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 2
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE