https://github.com/ecrmnn/drop-every
Returns an array with every nth item of the array dropped
https://github.com/ecrmnn/drop-every
array-manipulations arrays list
Last synced: 9 months ago
JSON representation
Returns an array with every nth item of the array dropped
- Host: GitHub
- URL: https://github.com/ecrmnn/drop-every
- Owner: ecrmnn
- License: mit
- Created: 2017-07-15T23:50:49.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-16T00:03:00.000Z (almost 9 years ago)
- Last Synced: 2025-05-31T22:29:33.374Z (about 1 year ago)
- Topics: array-manipulations, arrays, list
- Language: JavaScript
- Homepage: https://npmjs.com/drop-every
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# drop-every
> Returns an array of every nth item in the array dropped
[](https://travis-ci.org/ecrmnn/drop-every/builds)
[](http://badge.fury.io/js/drop-every)
[](http://badge.fury.io/js/drop-every)
[](http://badge.fury.io/js/drop-every)
[](http://makeapullrequest.com)
[](https://github.com/airbnb/javascript)
### Installation
```bash
npm install drop-every --save
```
### Usage
```javascript
const dropEvery = require('drop-every');
dropEvery([1, 2, 3, 4, 5], 2);
//=> [1, 3, 5]
dropEvery([1, 2, 3, 4, 5], 3);
//=> [1, 2, 4, 5]
dropEvery([1, 2, 3, 4, 5], n => n < 3));
//=> [3, 4, 5]
```
### License
MIT © [Daniel Eckermann](http://danieleckermann.com)