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

> Membandingkan dua function values berdasarkan function identity. Kedua arguments harus berupa functions. Function mengembalikan boolean result dari function identity(L, 1) == function identity(L, 2). Function tidak membandingkan function bytecode, source, behavior, hashes, upvalues, atau newcclosure mappings. comparefunction adalah alias untuk function yang sama.

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

  ## Alias

  * `comparefunction`

  ## Argumen

  <ParamField path={"func1"} type={"function"} required>
    First function value yang dikonversi dengan function identity.
  </ParamField>

  <ParamField path={"func2"} type={"function"} required>
    Second function value yang dikonversi dengan function identity.
  </ParamField>

  ## Return

  <ResponseField name={"equal"} type={"boolean"}>
    true saat kedua function values resolve ke function identity yang sama; jika tidak, false.
  </ResponseField>

  ## Contoh

  Compare two functions by their function identity.

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

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