RosettaCodeData/Task/Repeat/Swift/repeat.swift
2023-07-01 13:44:08 -04:00

7 lines
102 B
Swift

func repeat(n: Int, f: () -> ()) {
for _ in 0..<n {
f()
}
}
repeat(4) { println("Example") }