3 ms·
You can use `&` operator to combine types. Works for adding fields, making branded types, etc.
by auxiliarymoose 10mo ago
You can use `&` operator to combine types. Works for adding fields, making branded types, etc.
- g947o 10mo agowhich is not the same as "extends".
- spoiler 10mo agoThere's also a slight performance caveat when it comes to interfaces vs intersections (&) to keep in mind: https://github.com/microsoft/Typescript/wiki/Performance#preferring-interfaces-over-intersections https://github.com/microsoft/Typescript/wiki/Performance#pre...