You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
320 B

4 years ago
  1. # indexes-of
  2. like Array/String#indexOf but return all the indexes in an array.
  3. ``` js
  4. var indexesOf = require('indexes-of')
  5. var twosIndexes = indexesOf([1, 2, 3, 4, 5, 4, 3, 2, 1], 2)
  6. console.log(twosIndexes)
  7. // [1, 7]
  8. ```
  9. # Haiku
  10. * A 5 line module.
  11. * But the tests are 40 lines.
  12. * npm publish.
  13. ## License
  14. MIT