1.0.0 • Published 9 years ago
adjacents v1.0.0
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.
1.0.0
9 years ago