# diff

## definition

```scala
abstract def diff(that: GenSeq[A]): GenSeq[A]
```

## demo

```scala
val donutBasket1: Set[String] = Set("Plain Donut", "Strawberry Donut", "Glazed Donut")
val donutBasket2: Set[String] = Set("Glazed Donut", "Vanilla Donut")

val diffDonutBasket1From2: Set[String] = donutBasket1 diff donutBasket2

val diffDonutBasket2From1 :Set[String] = donutBasket2 diff donutBasket1
```

可以看下下面的输出

```scala
scala> val diffDonutBasket2From1 :Set[String] = donutBasket2 diff donutBasket1
diffDonutBasket2From1: Set[String] = Set(Vanilla Donut)

scala> val diffDonutBasket1From2: Set[String] = donutBasket1 diff donutBasket2
diffDonutBasket1From2: Set[String] = Set(Plain Donut, Strawberry Donut)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.selinux.tech/scala/function-operation/d/diff.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
