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: 30 November, 2023