reverse
definition
The reverse method will create a new sequence with the elements in reversed order.
def reverse: Reprdemo
val donuts: Seq[String] = Seq("Plain Donut", "Strawberry Donut", "Glazed Donut")
donuts.reverse.foreach(donut => println(s"donut = $donut"))Last updated
Was this helpful?