isClosure

Checks if a given object is a closure.

isClosure(object) → returns boolean

Argument Reference

object any
Required

The object to check if it is a closure.

Examples
Sample code invoking the isClosure function

square = function(x) {
    return x * x;
};

writeDump(isClosure(square));

Expected Result: TRUE

square = function(x) {
    return x * x;
};

squared = square(5);

writeDump(isClosure(squared));

Expected Result: FALSE

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub