> ## 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 من type 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 إلى نفس 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>
