---
metadata:
  - name: generator
    content: Diplodoc Platform v5.64.0
alternate:
  - https://divkit.tech/docs/en/concepts/divs/2/div-function.md
  - https://divkit.tech/docs/ru/concepts/divs/2/div-function.md
  - href: https://divkit.tech/docs/ru/concepts/divs/2/div-function.md
    type: text/markdown
    title: Markdown version
  - href: https://divkit.tech/docs/ru/llms.txt?revision=r21742482
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://divkit.tech/docs/ru/llms.txt?revision=r21742482

# div-function
Функция, определяемая пользователем.

## Параметры
| Параметры | Описание |
| --- | --- |
| `arguments` | <p>**array**</p><p>Обязательный параметр.</p><p>Аргумент функции.</p> |
| `body` | <p>**string**</p><p>Обязательный параметр.</p><p>Тело функции. Вычисляется как выражение с подставлением передаваемых аргументов. Не захватывает внешние переменные.</p> |
| `name` | <p>**string**</p><p>Обязательный параметр.</p><p>Название функции.</p><p>Значение должно удовлетворять регулярному выражению `^[a-zA-Z_][a-zA-Z0-9_]*$`.</p> |
| `return_type` | <p>**string**</p><p>Обязательный параметр.</p><p>Тип возвращаемого значения.</p><p>Возможные значения: `string`, `integer`, `number`, `boolean`, `datetime`, `color`, `url`, `dict`, `array`.</p> |

<details>
<summary>JSON</summary>

```json
{
  arguments*: [
    {
      name*: "string",
      type*: "string"
    },
    ...
  ],
  body*: "string",
  name*: "string",
  return_type*: "string"
}
```
</details>
