comparefunctions Synchronous

  • comparefunction

Compare two functions by their underlying callable definition and captured references rather than by table-style identity alone. This helps check whether a wrapper or clone still represents the same behavior.

Syntax
Luau
comparefunctions(first: Function, second: Function) -> boolean

Parameters

Function parameters
ParameterTypeDescription
firstFunctionFirst function.
secondFunctionSecond function.

Returns

boolean

true when Kawaii considers the callables equivalent; otherwise false.

Example

Example
Luau
local original = function(value) return value end
local copy = clonefunction(original)
print(comparefunctions(original, copy))
Kawaii documentation