TypeScript:
interface Worker { name: string; age: string; } interface student { name: string; addr: string; } export type ExcludeKeys = Exclude<keyof Worker, keyof student>; export type ExtractKeys = Extract<keyof Worker, keyof student>;
Exclude: 在Worker中找不存于student中的key。
Extract: 在Worker中找存在于student中的key。