Determines whether a value or expression references a function defined via a function expression, as opposed to a function statement.
True, if the value represents a function expression; otherwise False.
isClosure(object)
Other decision functions.
ColdFusion (2018 release): Introduced named parameters.
ColdFusion 10: Added this function.
Parameter |
Description |
|---|---|
object |
A value. |
Use this function to determine whether the value or expression represents a function defined via a function expression.
<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
Sign in to your account