4 ms·
What you're "missing", I think, is that Typescript's types only exist at compile-time, so they aren't available through runtime operations like instanceof. It's
by stupidcar 8y ago
What you're "missing", I think, is that Typescript's types only exist at compile-time, so they aren't available through runtime operations like instanceof. It's like a more extensive case of Java generics erasure.
- itslennysfault 8y agoUnless you use metadata reflection. Angular, NestJS, etc use this for dependency injection with great success.