---
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/en/concepts/divs/2/div-function.md
    type: text/markdown
    title: Markdown version
  - href: https://divkit.tech/docs/en/llms.txt?revision=r21742482
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://divkit.tech/docs/en/llms.txt?revision=r21742482

# div-function
User-defined function.

## Parameters
| Parameters | Description |
| --- | --- |
| `arguments` | <p>**array**</p><p>Required parameter.</p><p>Function argument.</p> |
| `body` | <p>**string**</p><p>Required parameter.</p><p>Function body. Evaluated as an expression using the passed arguments. Doesn't capture external variables.</p> |
| `name` | <p>**string**</p><p>Required parameter.</p><p>Function name.</p><p>The value must match the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`.</p> |
| `return_type` | <p>**string**</p><p>Required parameter.</p><p>Return value type.</p><p>Possible values: `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>
