repeat function
Executes the given function action
specified number of times
.
A zero-based index of current iteration is passed as a parameter to action
.
Implementation
@pragma('vm:prefer-inline')
@pragma('dart2js:tryInline')
void repeat(int times, void Function(int) action) {
for (var i = 0; i < times; i++) {
action(i);
}
}