# intersection function

The elements that are in every one of some lists.

## How to write it

### intersection(a, b, ...)

**a**

A list. Takes a list.

**b**

A list. Takes a list.

## Examples

- $\displaystyle \operatorname{intersection}(\left[ 1, 2 \right], \left[ 2, 3 \right]) = \left[ 2 \right]$

  `intersection([1, 2], [2, 3])`

  In the solver, `intersection([1, 2], [2, 3])` gives `[2]`.

  [Open in the solver](https://hilberon.com/?q=intersection%28%5B1%2C%202%5D%2C%20%5B2%2C%203%5D%29)

## Related functions

- [join](https://hilberon.com/library/join)

  Join lists into one.
- [head](https://hilberon.com/library/head)

  The head of an expression: the name of the function it is a call of.
- [last](https://hilberon.com/library/last)

  The last element of a list.
- [fold_list](https://hilberon.com/library/fold_list)

  The steps of fold: every partial result, starting from the first value.
- [length](https://hilberon.com/library/length)

  Number of elements in a list.
- [fold](https://hilberon.com/library/fold)

  Combine the elements of a list from the left with a function, starting from a value.

---
Source: https://hilberon.com/library/intersection
