range function

Iterable<int> range({
  1. required int last,
  2. int first = 0,
  3. int step = 1,
})

creates a list of 2-element lists with pairs of a and be values. example: zip(1,2,3,4,5,6) -> [1,4,2,5,3,6]

Implementation

//List<List<T>> zip<T>(List<T> a, List<T> b) =>
//    a.mapIndexed((index, element) => [element, b[index]]).toList();

Iterable<int> range({required int last, int first = 0, int step = 1}) sync* {
  for (int i = first; i <= last; i += step) {
    yield i;
  }
}