Skip to content
Functions & closuresReference

iscclosure

Identifies native closures.

Details#

Checks whether a value is a C closure, including a newcclosure wrapper. Non-functions return false rather than raising a type error.

Signature#

Luau
iscclosure(value: any): boolean

Parameters#

ParameterTypeDescription
valueanyValue to classify; non-functions return false.

Returns#

A boolean classification of value.

Examples#

Example

Luau
print(iscclosure(print)) -- true
print(iscclosure(123)) -- false