1.

How to check type of variable in typescript?

Answer»

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
}



Discussion

No Comment Found