Hacker News new | ask | show | jobs
by fire_lake 700 days ago
C# has record (product) types now.
1 comments

I'm not sure about the terminology here, but the & in TS is much more than a record. You can use it to smush types together e.g.

{name: string} & {birthday: Date}

becomes a single type with both properties.

Product types are tuple types.

Record types are tuple types with names instead of indexes.

The TypeScript “&” is another thing.