repeat function

void repeat(
  1. Int times,
  2. void action(
    1. Int
    )
)

Executes the given function action specified number of times.

Implementation

Unit repeat(Int times, Unit Function(Int) action) {
  for (var i = 0; i < times; i++) {
    action(i);
  }
}