I\'m looking for an equivalent of:
for(_ <- 1 to n) some.code()
that would be shortest and most elegant. Isn\'t there in Scala anything si
I would suggest something like this:
List.fill(10)(println("hi"))
There are other ways, e.g.:
(1 to 10).foreach(_ => println("hi"))
Thanks to Daniel S. for the correction.