questions/00645-medium-diff/README.zh-CN.md
获取两个接口类型中的差值属性。
type Foo = {
a: string;
b: number;
}
type Bar = {
a: string;
c: boolean
}
type Result1 = Diff<Foo,Bar> // { b: number, c: boolean }
type Result2 = Diff<Bar,Foo> // { b: number, c: boolean }
<a href="../../README.zh-CN.md" target="_blank"></a> <a href="https://tsch.js.org/645/answer/zh-CN" target="_blank"></a> <a href="https://tsch.js.org/645/solutions" target="_blank"></a> <!--info-footer-end-->