zip method

Iterable<List> zip(
  1. Iterable other
)

Zips this iterable with another other iterable.

Example:

[1, 2].zip(['a', 'b']); // [[1, 'a'], [2, 'b']]

Implementation

Iterable<List<dynamic>> zip(Iterable<dynamic> other) sync* {
  final it1 = iterator;
  final it2 = other.iterator;
  while (it1.moveNext() && it2.moveNext()) {
    yield [it1.current, it2.current];
  }
}