> For the complete documentation index, see [llms.txt](https://www.selinux.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.selinux.tech/scala/function-operation/r/reverse.md).

# reverse

## definition

The reverse method will create a new sequence with the elements in reversed order.

```scala
def reverse: Repr
```

## demo

```scala
val donuts: Seq[String] = Seq("Plain Donut", "Strawberry Donut", "Glazed Donut")

donuts.reverse.foreach(donut => println(s"donut = $donut"))
```
