Answers for "typescript get type"

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

Code answers related to "TypeScript"

Browse Popular Code Answers by Language