isInstanceOf

Determines whether an object is an instance of a ColdFusion interface or component, or of a Java class.

isInstanceOf(value, type) → returns boolean

Argument Reference

value any
Required

The CFC instance or Java object that you are testing

type string
Required

The name of the interface, component, or Java class of which the object might be an instance

Examples
Sample code invoking the isInstanceOf function

Dates in CFML are instances of the java class: java.util.Date

isInstanceOf(now(), "java.util.Date");

Expected Result: true

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

Fork me on GitHub