Closures

islclosure

Returns whether a function is a Luau closure.

Syntax

islclosure(func: function): boolean
Aliases isluaclosure

Arguments

NameTypeDescription
funcfunctionFunction to test.

Returns

NameTypeDescription
isLClosurebooleanTrue when the function is a Luau closure.

Description

Returns whether a function is a Luau closure.

Call it with 1 parameter(s): func. The argument table explains which values are required and which ones only refine the behavior.

It returns isLClosure (boolean). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = islclosure(function() end)
print(result)