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

> Compara dois function values pelo function identity. Ambos arguments devem ser functions. A function retorna o boolean result de function identity(L, 1) == function identity(L, 2). Ela não compara function bytecode, source, behavior, hashes, upvalues nem newcclosure mappings. comparefunction é um alias da mesma function.

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

  ## Aliases

  * `comparefunction`

  ## Argumentos

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

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

  ## Retornos

  <ResponseField name={"equal"} type={"boolean"}>
    true quando ambos function values resolvem para o mesmo function identity; caso contrário false.
  </ResponseField>

  ## Exemplo

  Compare two functions by their function identity.

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

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