WingNews logo WingNews
top | new | best | ask | show | jobs
top | item 46268246

(no title)

auxiliarymoose | 2 months ago

You can use `&` operator to combine types. Works for adding fields, making branded types, etc.

discuss

order

g947o|2 months ago

which is not the same as "extends".

spoiler|2 months ago

There's also a slight performance caveat when it comes to interfaces vs intersections (&) to keep in mind: https://github.com/microsoft/Typescript/wiki/Performance#pre...
powered by hn/api // news.ycombinator.com