So, i have a problem where i'm constantly running into undifined errors, (in browser) and seemingly can't figure out why / how to get around it. From what i've gathered is that the keyword "this" is an utterly confusing mess in js & inherently in ts too.
Here is my problme:
export class XY
{
property: boolean;
//other proprs
constructor()
{this.property = false;}
setproperty(e) //this is an onclick event
{
this.property = true;
//my problem is that this.property doesn't refer to class member variable "property"
}
}
even if i try something like const boundGet = XY.bind.(xy), it still undefined and "unreachable"
if not with the keyword "this", how am i supposed to refer to member variable property without making it const??