IsInstanceOf
Last updated
Was this helpful?
Determines whether an object is an instance of a BoxLang interface or component, or of a Java class.
IsInstanceOf(object=[any], typename=[string])object
any
true
The CFC instance or Java object that you are testing
typename
string
true
The name of the interface, component, or Java class of which the object might be an instance
Dates in BL are instances of the java class: java.util.Date
isInstanceOf( now(), "java.util.Date" );
Result: false
Last updated
Was this helpful?
Was this helpful?
writeDump( isInstanceOf( {}, "java.util.Map" ) ); // true
writeDump( isInstanceOf( "Boxlang", "java.util.Map" ) ); // false
writeDump( isInstanceOf( "Boxlang", "java.lang.String" ) );
// true
