# union function

The elements in any of some lists, each once, in order.

## How to write it

### union(a, b, ...)

**a**

A list. Takes a list.

**b**

A list. Takes a list.

## Examples

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

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

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

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

## Related functions

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

  Running totals of a list.
- [total](https://hilberon.com/library/total)

  Sum of the elements of a list.
- [append](https://hilberon.com/library/append)

  A list with an element added at the end.
- [thread](https://hilberon.com/library/thread)

  Apply a function to corresponding elements of lists.
- [apply](https://hilberon.com/library/apply)

  Replace the head of an expression, or the brackets of a list, with a function.
- [tally](https://hilberon.com/library/tally)

  How often each element occurs: a list of element and count pairs.

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