Skip to content

domharrington/array-interlace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

array-interlace

Interlace the contents of an array

build status

Takes an array, splits it in half, then takes it in turns to push an item from each split array back onto a new array

Installation

npm install array-interlace --save

Usage

var arrayInterlace = require('array-interlace')

console.log(arrayInterlace([ 1, 2, 3, 4, 5, 6 ]))
// Array is [ 1, 4, 2, 5, 3, 6 ]

var interlacedArray = arrayInterlace(array)

Options must include:

  • array - an array to interlace

Credits

Dom Harrington

About

Interlace the contents of an array

Resources

License

Stars

Watchers

Forks

Packages