repeat function
Executes the given function action
specified number of times
.
Implementation
repeat(int times, void action(int)) {
for (int i = 0; i < times; i++) {
action(i);
}
}
Executes the given function action
specified number of times
.
repeat(int times, void action(int)) {
for (int i = 0; i < times; i++) {
action(i);
}
}