面试题答案
一键面试type T = { a: string; b: number; c: boolean; };
type U = { a: string; d: number; };
type CommonProps = Extract<keyof T, keyof U>;
type CommonPropsType = {
[K in CommonProps]: T[K];
};
type T = { a: string; b: number; c: boolean; };
type U = { a: string; d: number; };
type CommonProps = Extract<keyof T, keyof U>;
type CommonPropsType = {
[K in CommonProps]: T[K];
};