# Anonymous function (function)

A function with no name; also written x => body.

## How to write it

### function(parameters, body)

**parameters**

The parameter, or a list of parameters in brackets. Takes a variable, or a list of variables.

**body**

The expression to evaluate. Takes an expression.

## Examples

- $\displaystyle (x \mapsto x^{2})(3) = 9$

  `(x => x^2)(3)`

  In the solver, `(x => x^2)(3)` gives `9`.

  [Open in the solver](https://hilberon.com/?q=%28x%20%3D%3E%20x%5E2%29%283%29)

## Related functions

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

  A value chosen by a test.
- [evaluate](https://hilberon.com/library/evaluate)

  Evaluate an expression even where it would be held.
- [increment](https://hilberon.com/library/increment)

  Add 1 to a variable in place and return its old value.
- [divide_by](https://hilberon.com/library/divide_by)

  Divide a variable by a value in place and return the new value.
- [indicator](https://hilberon.com/library/indicator)

  A condition as a number: 1 when it is true and 0 when it is false.
- [decrement](https://hilberon.com/library/decrement)

  Subtract 1 from a variable in place and return its old value.

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