Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bjarneo/array-append-x

Append an element for every X element in an array.
https://github.com/bjarneo/array-append-x

Last synced: 3 days ago
JSON representation

Append an element for every X element in an array.

Awesome Lists containing this project

README

        

array-append-x
======

What
------
Append an element for every X element in an array.

Installation
------
```
$ npm install --save array-append-x
```

Usage
------
```javascript
var arrayAppendX = require('array-append-x');
var num = [0, 0, 0, 0, 0, 0, 0];

console.log(arrayAppendX(num, 1, 4));

// Output:
[0, 0, 0, 1, 0, 0, 0, 1, 0]
```

Test
------
```
npm test
```

Contribution
------
Contributions are appreciated.

License
------
MIT-licensed. See LICENSE.