DEV Community


Discussion on: How I improve my skills in Typescript

dobromyslov profile image
Viacheslav Dobromyslov • Edited

But when you add new type Duck you will not be able to differentiate pets and fishes from Duck just checking available methods because a Duck can both swim and fly. In that case you will have to turn to Thorsten's explicit kind of an animal.

Thread Thread
codeozz profile image
CodeOzz Author

In the case of your interface growth you will need to use another way to put in the type guard yes. But in this exemple it's overkill to use more properties