1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-14 01:26:11 -05:00
notes/node_modules/indexes-of
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00
..
.npmignore Initial commit 2017-03-09 13:16:08 -05:00
index.js Initial commit 2017-03-09 13:16:08 -05:00
LICENSE Initial commit 2017-03-09 13:16:08 -05:00
package.json Initial commit 2017-03-09 13:16:08 -05:00
README.md Initial commit 2017-03-09 13:16:08 -05:00
test.js Initial commit 2017-03-09 13:16:08 -05:00

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