adjacents
v1.0.0
Published
return all adjacent pairs of values in an array
Downloads
1
Readme
adjacents
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.