This may be looking similar to previous questions, but I didn't find my answer, so I asked it here. My example:
Class A{
id:number;
name:string;
}
Class B{
id:number;
name:string;
age:number;
grade:number;
}
const b = new B {id:1, name:'John', age: 20, grade: 10}
Now I want to initialize a new instance of class A only with two attributes from class B. Something like this:
const a = b as A;
I need my result look like this:
a = {id:1, name:'John'}
Thanks,