pairs<T> function
Transforming data
Returns a list of pairs from consecutive values of the provided iterable
.
For example:
pairs([1, 2, 3, 4]); // returns [[1, 2], [2, 3], [3, 4]]
If the specified iterable has fewer than two values, returns the empty list.
Implementation
List<(T, T)> pairs<T>(Iterable<T> iterable) =>
pairsWith<T, (T, T)>(iterable, _pair);