islclosure Synchronous

  • isluaclosure

Tell whether a function is a Luau closure. Check this before reading or changing its constants or nested prototypes.

Syntax
Luau
islclosure(value: Function) -> boolean

Parameters

Function parameters
ParameterTypeDescription
valueFunctionThe function to inspect. Passing a non-function raises an error.

Returns

boolean

true for a Luau closure; false for a C closure.

Example

Example
Luau
local scripted = function() return 42 end
print(islclosure(scripted)) -- true
print(islclosure(newcclosure(scripted))) -- false
Kawaii documentation