Tipo de verificación TypeScript Tipo de variable
if (fooOrBar instanceof Foo){
// TypeScript now knows that `fooOrBar` is `Foo`
}
Dotch
if (fooOrBar instanceof Foo){
// TypeScript now knows that `fooOrBar` is `Foo`
}
if (typeof abc === "number") {
// do something
}
200000000000000000000000000000000000