if (fooOrBar instanceof Foo){ // TypeScript now knows that `fooOrBar` is `Foo` }
mySprite instanceof Sprite;