Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

83
Views
What is a possible cause for the 'is not a function' error in this case?

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?!

7 months ago ยท Juan Pablo Isaza
Answer question
Find remote jobs