# `prior`

_Wrapper for the Each Prior iterator_
```syntax
 v2 prior x      prior[v2;x]
(vv)prior x      prior[vv;x]
```

Where

- `v2` is a binary [applicable value](glossary.md#applicable-value)
- `vv` is a [variadic](variadic.md) applicable value

applies `v2` or `vv` to each item of `x` and the item preceding it, and returns a result of the same length.

That is, the projections `prior[v2;]` and `prior[vv;]` are [uniform](glossary.md#uniform-function) functions.
```q
q)(+) prior til 10
0 1 3 5 7 9 11 13 15 17
q){x+y%10}prior til 10
0n 1 2.1 3.2 4.3 5.4 6.5 7.6 8.7 9.8
```

`prior` is a wrapper for the [Each Prior](maps.md#each-prior) iterator, which describes how q determines the first item of the result.

> **Tip — Prefer `prior` to the Each Prior iterator, except where you compose iterators and brevity helps.**
>
>
----

[Each Prior](maps.md#each-prior)
