how to detect type in typescript code example Example: typescript check type mySprite instanceof Sprite;