主页
TypeScript
TypeScript 实用工具类型
demo_utility_types_omit
运行 ❯
×
更改方向
保存代码
更改主题
interface Person { name: string; age: number; location?: string; } const bob: Omit
= { name: 'Bob' // `Omit` has removed age and location from the type and they can't be defined here }; console.log(bob);
{ name: 'Bob' }