TypeScript里的类型合并操作符& 已注销 2021-04-26 142 阅读1分钟 通过 & 运算符可以将现有的多种类型叠加到一起成为一种类型: type PointX = { x: number; }; type PointY = { y: number; } type Point = PointX & PointY; const point:Point = { x: 1, y: 1}; 编译之后的JavaScript代码: var point = { x: 1, y: 1 };