I am new to TypeScript and am encountering an issue with variable declaration in my component function. I am trying to declare a local variable "contains" like this:
setUpgrade($event) {
contains : Boolean = this.selectedUpgrades.includes($event);
//some logic
}
However, I am getting an error on this line:
contains : Boolean = this.selectedUpgrades.includes($event);
The error I am receiving is:
Type 'boolean' is not assignable to type 'BooleanConstructor'.
Can someone help me understand why this error is happening during variable declaration?