Is there a way to do something like:
0 to -10 map { i=>
...
}
repl gives me:
scala.collection.immutable.IndexedSeq[Unit] = Vector()
0 to (-10, -1)
or
0 to -10 by -1
Add the by
clause:
0 to -10 by -1
res0: Range(0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With