Encountering an error in my Angular 7 project related to the sort function in TypeScript. The error message states: "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type'".
Interesting workaround involves commenting out the function initially, running the application, and then uncommenting the function post-application launch to get it working as expected with the sort functionality included.
Specifically, attempting to sort dates in descending order.
this.SortArray = this.project.Attributes.sort(function (a, b) {
return new Date(a.EffDate) - new Date(b.EffDate);
});