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

> Vergleicht zwei function values über ihren function identity. Beide arguments müssen functions sein. Die function gibt das boolean result von function identity(L, 1) == function identity(L, 2) zurück. Sie vergleicht kein function bytecode, source, behavior, hashes, upvalues oder newcclosure mappings. comparefunction ist ein alias für dieselbe function.

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

  ## Aliase

  * `comparefunction`

  ## Argumente

  <ParamField path={"func1"} type={"function"} required>
    First function value, der mit function identity konvertiert wird.
  </ParamField>

  <ParamField path={"func2"} type={"function"} required>
    Second function value, der mit function identity konvertiert wird.
  </ParamField>

  ## Rückgaben

  <ResponseField name={"equal"} type={"boolean"}>
    true, wenn beide function values zum selben function identity aufgelöst werden; andernfalls false.
  </ResponseField>

  ## Beispiel

  Compare two functions by their function identity.

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

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