Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 690 Bytes

README.md

File metadata and controls

35 lines (23 loc) · 690 Bytes

in-overlapping-pairs

Build Status npm version

Maps the given array into pairs of overlapping elements in subarrays

Install

npm install in-overlapping-pairs

Usage

import inOverlappingPairs from 'inOverlappingPairs'

inOverlappingPairs([1,2,3,4,5,6])
// > [[1,2], [2,3], [3,4], [4,5], [5,6]]

An empty array maps to an empty subarray:

inOverlappingPairs([])
// > [[]]

License

ISC