How to check type of variable in typescript?
The typeof command is used to check the data type of any variable in Typescript.
Example:
Variable: abc:number|string;
if (typeof abc === "number") {
// do something
}
BY Best Interview Question ON 12 May 2020