typescript check type in if statement code example Example: typescript check type mySprite instanceof Sprite;