1.0.0 • Published 9 years ago

adjacents v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
9 years ago

adjacents npm.io

A function that returns an array of the pairs of adjacent values in the input array. “Adjacent” as in next to each other in the array.

When there aren't enough elements to form pairs (0 or 1), it'll return an empty array.

Example

adjacents([ 1, 2, 3, 4 ])
[ [ 1, 2 ], [ 2, 3 ], [ 3, 4 ] ]

License

ISC.