How can I effectively take only few arguments from parent object?
interface A {
id: number;
title: string;
description: string;
}
interface B extends Omit<A , 'id'> {}
const a: A = {
title: "",
description: "",
id: 0,
}
const b: B = {...a}; // attribute 'id' is also included in object 'b' even it's not in interface B.
I don't want to pick attributes manually.
And the second question, why assigning for object b is valid though id is not in interface B and b contains this attr in the end? I expected that only title and description will be present in this object. Thanks