islclosure

Checks whether a function is a Luau closure.

Syntax

Signature
islclosure(Function: function) -> boolean

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
FunctionfunctionFunction to inspect.

Returns

TypeDescription
booleanTrue for a Luau closure.

Notes

Passing a value that is not a function raises an argument error.

Example

Luau
local Result = islclosure(function() return 42 end)
print(Result)