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: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.