isObject

Determines whether a value is an object.
True, if the value represents a CFML object. False if the value is any other type of data, such as an integer, string, date, or struct.

isObject(value) → returns boolean

Argument Reference

value any
Required

Examples
Sample code invoking the isObject function

Returns true if the parameter is a CFML object. The CFML object here is a Java object.

random = createObject( "java", "java.security.SecureRandom" ).getInstance( "SHA1PRNG" );
writeOutput( isObject( random ) );

Expected Result: true

Returns false if the parameter is any data type other than a CFML object

example = { 'name' = 'I am a struct' };
writeOutput( isObject( example ) );

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