When working with an optional type argument function RECT(T
rect<T extends Date | number>(x1:T, y1:T,x2?:T, y2?:T) {
if(x1 instanceof Date) {
this.opportunityArea.dx = this.returnNumberFunc(x1);
} else {
this.opportunityArea.dx = x1; //**TS2322: Type 'T' is not assignable to type 'number'.**
}
}