repeat<T> function

Iterable<T> repeat<T>(
  1. T item,
  2. int n
)

Repeats an item n times.

Implementation

Iterable<T> repeat<T>(T item, int n) sync* {
  for (int i = 0; i < n; ++i) {
    yield item;
  }
}