> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# comparefunctions

> Сравнивает два function values по их function identity. Оба arguments должны быть functions. Function возвращает boolean result выражения function identity(L, 1) == function identity(L, 2). Она не сравнивает function bytecode, source, behavior, hashes, upvalues или newcclosure mappings. comparefunction является alias для той же function.

<div className="real-function-page">
  ```lua theme={null}
  comparefunctions(func1: function, func2: function): boolean
  ```

  ## Алиасы

  * `comparefunction`

  ## Аргументы

  <ParamField path={"func1"} type={"function"} required>
    First function value, преобразуемое через function identity.
  </ParamField>

  <ParamField path={"func2"} type={"function"} required>
    Second function value, преобразуемое через function identity.
  </ParamField>

  ## Возвраты

  <ResponseField name={"equal"} type={"boolean"}>
    true, когда оба function values resolve в один и тот же function identity; иначе false.
  </ResponseField>

  ## Пример

  Compare two functions by their function identity.

  ```lua theme={null}
  local function sample()
      return "ok"
  end

  local same = comparefunctions(sample, sample)
  print(same)
  ```
</div>
