RosettaCodeData/Task/Repeat/Scala/repeat-1.scala
2023-07-01 13:44:08 -04:00

3 lines
98 B
Scala

def repeat[A](n:Int)(f: => A)= ( 0 until n).foreach(_ => f)
repeat(3) { println("Example") }