typescript 2.8 - Conditional Type



Conditional Type

Which basically trying to say if  type A kinda like B type, then we can just use C type.

interface Car {
drive(): void; } interface Ferarri extends Car { drivefaster(): void; } // Foo becomes number type Foo = Ferarri extends Car ? number : string;


Comments

Popular posts from this blog

ionic2 cordova build android - Unable resolve gradle 2.2.3

A quick tutorial for OWASP ZAP tool for beginners