title: I can't call a class function inside another class function in Javascript
body: <p>I want to call the function &quot;displayTime&quot; in &quot;startTimer&quot; but for some reason I get &quot;Uncaught TypeError: this.displayTime is not a function&quot; in the console.</p>
  <pre><code>let endTimer = &quot;0&quot;;
  let isRunning = false;
  
  //! CLASS
  class Timer {
    constructor(endTimer, isRunning) {
      this.endTimer = endTimer;
      this.isRunning = isRunning;
    }
  
    startTimer() {
      if (this.endTimer === &quot;0&quot;) {
        this.endTimer = new Date().getTime() + 1500000;
      }
      displayTime();
      if (this.isRunning === true) {
        this.pauseTimer();
        this.isRunning
      }
      this.isRunning = true;
    }
  
    displayTime() {
      let now = new Date().getTime();
      let remainingTime = this.endTimer - now;
      let minutes = Math.floor(remainingTime / 1000 / 60);
      let seconds = Math.floor((remainingTime / 1000) % 60);
      if (seconds &lt; 10) {
        seconds = &quot;0&quot; + seconds;
      }
      timer.innerHTML = `&lt;h1&gt;${minutes}:${seconds}&lt;/h1&gt;`;
      start.textContent = &quot;STOP&quot;
      this.update = setInterval(this.displayTime, 100);
    }
  }
  
  let newTimer = new Timer(endTimer, isRunning);
  
  //! EVENT LISTENERS
  
  start.addEventListener(&quot;click&quot;, newTimer.startTimer);
  </code></pre>
  <p>I think that I'm missing something obvious, but I don't understand what...</p>