I have a data called: cat_pressed
There is also this function that changes the data value:
changeCat(){ this.cat_pressed === 'brauh' }
But whenever I call the function the value doesn't change, I don't know why I've tried everything but nothing works.
P粉5233350262024-04-04 07:56:06
It looks like you accidentally used the wrong operator.
Use=== for checking equality - but you want the value to be assigned to cat_pressed
, so you need =.
changeCat(){ this.cat_pressed = 'brauh' }