I have following code:
val A = List(...)
val items = A.map(..magic#1..).filter(..magic#2..).map(..magic#3..)
val rndItem = items(Random.nextInt(items.size))
But I want this:
val A = List(...)
val rndItem = A.map(..magic#1..).filter(..magic#2..).map(..magic#3..).getRandom()
Can I do this on scala?
I seen question#1 and question#2