API Reference > bentleyjs-core > Utils > asInstanceOf asInstanceOf Function Cast obj to an instance of class T, or return undefined if obj is not an instance of class T. asInstanceOf<T>(obj: any, constructor: Constructor<T>): T | undefined see isInstanceOf to query whether obj is of class T. Parameter Type Description obj any constructor Constructor<T> Returns - T | undefined Defined in core/bentley/src/InstanceOf.ts Line 29 Last Updated: 11 June, 2024