Irina Glushko 2389e7160b HW1 done 3 年 前
..
.npmignore 2389e7160b HW1 done 3 年 前
LICENSE 2389e7160b HW1 done 3 年 前
README.md 2389e7160b HW1 done 3 年 前
index.js 2389e7160b HW1 done 3 年 前
package.json 2389e7160b HW1 done 3 年 前
test.js 2389e7160b HW1 done 3 年 前

README.md

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