Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
auxiliarymoose
3 days ago
|
parent
|
context
|
favorite
| on:
JSDoc is TypeScript
You can use `&` operator to combine types. Works for adding fields, making branded types, etc.
g947o
3 days ago
[–]
which is not the same as "extends".
reply
spoiler
3 days ago
|
parent
[–]
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...
reply
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: