https://github.com/gitfaf/indices-for-same-value
Get all the indices for same value in an array.
https://github.com/gitfaf/indices-for-same-value
Last synced: 6 months ago
JSON representation
Get all the indices for same value in an array.
- Host: GitHub
- URL: https://github.com/gitfaf/indices-for-same-value
- Owner: gitfaf
- License: mit
- Created: 2017-09-19T13:07:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-19T13:43:45.000Z (over 8 years ago)
- Last Synced: 2025-04-21T11:43:18.132Z (9 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Indices for same value
Get all the indices for a given value in an array.
```bash
npm i -S indices-for-same-value
```
```javascript
const getAllIndices = require('indices-for-same-value').getAllIndices
getAllIndices(10, [10, 2, 3, 4, 5, 6, 7, 10, 10 ,10])
// returns
// ["0", "7", "8", "9"]
```
## Testing
`jasmine`
## License
MIT © Git Faf 2017