Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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




which is not the same as "extends".

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...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: