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

The specified initialization vector (IV) does not match the block size for this algorithm