I have this and I can't use the method in the class because of the error shown below.
class Product {
a:number
b:number
get total() {
return this.a * this.b;
}
}
var product: Product={
a:2,
b:3
}
The error:
Type '{ a: number; b: number; }' is not assignable to type 'Product'. Property 'total' is missing in type '{ a: number; b: number; }'.