> ## 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

> Porównuje dwa function values przez ich function identity. Oba arguments muszą być functions. Function zwraca boolean result z function identity(L, 1) == function identity(L, 2). Nie porównuje function bytecode, source, behavior, hashes, upvalues ani newcclosure mappings. comparefunction jest alias dla tej samej function.

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

  ## Aliasy

  * `comparefunction`

  ## Argumenty

  <ParamField path={"func1"} type={"function"} required>
    First function value konwertowana przez function identity.
  </ParamField>

  <ParamField path={"func2"} type={"function"} required>
    Second function value konwertowana przez function identity.
  </ParamField>

  ## Zwroty

  <ResponseField name={"equal"} type={"boolean"}>
    true, gdy oba function values rozwiązują się do tego samego function identity; w przeciwnym razie false.
  </ResponseField>

  ## Przykład

  Compare two functions by their function identity.

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

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