Whatever message this page gives is out now! Go check it out!

IsClosure

Last update:
May 18, 2026

Description

Determines whether a value or expression references a function defined via a function expression, as opposed to a function statement.

Returns

True, if the value represents a function expression; otherwise False.

Category

Syntax

isClosure(object)

See also

History

ColdFusion (2018 release): Introduced named parameters.
ColdFusion 10: Added this function.

Parameters

Parameter
Description
object
A value.

Usage

Use this function to determine whether the value or expression represents a function defined via a function expression.

Example

 
<cfscript>
// Non-closure
function1 = 'Hello_World';
writeoutput("Is it closure: " & isClosure(function1) & "<br>");

// Closure
function2 = function () {};
writeoutput("Is it closure: " & isClosure(function2));
</cfscript>
Output
Is it closure: NO

Is it closure: YES

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page