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/UtilityTypes.ts Line 46
Last Updated: 24 June, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.