zip<R> method

Iterable<Pair<T, R>> zip<R>(
  1. Iterable<R> other
)

Creates new collection of pairs from two collections

Implementation

Iterable<Pair<T, R>> zip<R>(Iterable<R> other) {
  return length == other.length
      ? mapIndexed((index, item) => Pair(item, other.elementAt(index)))
      : [];
}