Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
320 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | # indexes-of
|
---|
| 2 |
|
---|
| 3 | like Array/String#indexOf but return all the indexes in an array.
|
---|
| 4 |
|
---|
| 5 | ``` js
|
---|
| 6 | var indexesOf = require('indexes-of')
|
---|
| 7 |
|
---|
| 8 | var twosIndexes = indexesOf([1, 2, 3, 4, 5, 4, 3, 2, 1], 2)
|
---|
| 9 |
|
---|
| 10 | console.log(twosIndexes)
|
---|
| 11 |
|
---|
| 12 | // [1, 7]
|
---|
| 13 |
|
---|
| 14 | ```
|
---|
| 15 |
|
---|
| 16 | # Haiku
|
---|
| 17 |
|
---|
| 18 | * A 5 line module.
|
---|
| 19 | * But the tests are 40 lines.
|
---|
| 20 | * npm publish.
|
---|
| 21 |
|
---|
| 22 | ## License
|
---|
| 23 |
|
---|
| 24 | MIT
|
---|
Note:
See
TracBrowser
for help on using the repository browser.