https://kotlinlang.org logo
k

Karlo Lozovina

09/22/2021, 9:03 AM
Is there a stdlib function like
repeat()
but that returns the result as a collection? to the effect like
(0..i).map() { foo() }
?
e

ephemient

09/22/2021, 9:05 AM
Copy code
List(n) { foo() }
k

Karlo Lozovina

09/22/2021, 9:06 AM
oh cool, didn't know about that one!
c

CLOVIS

09/22/2021, 9:43 AM
It also works with
Array
:)
2 Views