cast
Cast variable to the desired type without type checking.
Signature
cast<T>(input: any): T
Parameters
Name | Type | Optional | Description |
---|---|---|---|
input | any | No | Specifies the input. |
Return value
Returns the desired type.
Example
// `an` has the `any` type.
const a: any = 1;
// `b` is now of type `number` and contains `1`.
const b = cast<number>(a);