never类型
高级类型
联合类型与extends的区别
Difference between extending and intersecting interfaces in TypeScript?
in
function showType(arg: FirstType | SecondType) {if ('x' in arg) {console.log(`The property ${arg.x} exists`);return `The property ${arg.x} exists`;}throw new Error('This type is not expected');}
