breakAsPairs

Breaks this list into a list of consecutive pairs. Each element is paired with the next element in the list. For a list of size n, the result will contain n-1 pairs.

Example: [1, 2, 3, 4].breakAsPairs() returns [(1, 2), (2, 3), (3, 4)]

Return

A list of pairs where each pair consists of consecutive elements

Type Parameters

T

The type of elements in the list