Did some findings on type vs interface, here& #39;s what I& #39;ve understood so far https://abs.twimg.com/emoji/v2/... draggable="false" alt="đź§µ" title="Thread" aria-label="Emoji: Thread">
People tend to use interface for objects since its more natural while reading compared to type aliases which creates confusion.
Interfaces are easy to merge. This is is useful for adding missing type information on 3rd party libraries. If you are authoring a library and want to allow this capability, then interfaces are the way to go.
For functions from a readability perspective type alias may work out better.
Whether you’ve chosen a type or an interface the way we use it with a class is the same.
Type aliases can represent primitive types, but interfaces can’t. Interfaces are restricted to an object type.
Type aliases can represent tuple types, but interfaces can’t.
Type aliases can use computed properties. The "in" keyword can be used to iterate over all of the items in union of keys.
I& #39;ve just published a post covering all of this https://abs.twimg.com/emoji/v2/... draggable="false" alt="🎉" title="Partyknaller" aria-label="Emoji: Partyknaller"> https://kamleshchandnani.com/articles/ughh-type-vs-interface">https://kamleshchandnani.com/articles/...
You can follow @_kamlesh_.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: