I'm a beginner developer and working on a simple word game. I created a class that produces single-round objects for each given word and one of the private methods in it results in an error.
I looked through all the possible reasons for that error on MDN and none of them were applicable (as to me).
This is the method:
_deactivateChallengeBtn () {
this._element.classList.add('challenge-button__complete');
this._element.querySelector('.challenge-button-word').innerHTML = this.word;
this._element.querySelector('.challenge-button-score').innerHTML = this.score;
}
And this is a method from the same class, that calls the latter:
_endGame () {
deactivateKeyboard ();
resetGivenWord ();
resetUserWordList ();
this._deactivateChallengeBtn ();
toggleScreens ();
}
What am I missing here?!