typescript see if object is of type code example Example: typescript check type mySprite instanceof Sprite;