Typ kontroli Typincript typu zmiennej
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
}
mySprite instanceof Sprite;