Answers for "typescript check type of variable"

3

typescript check type of variable

if (fooOrBar instanceof Foo){
  // TypeScript now knows that `fooOrBar` is `Foo`
}
Posted by: Guest on December-03-2020
1

typescript get type

if (typeof abc === "number") {
    // do something
}
Posted by: Guest on September-14-2020
1

typescript check type

mySprite instanceof Sprite;
Posted by: Guest on December-03-2020

Code answers related to "typescript check type of variable"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language