title: Have object’s self-made button call object’s method
body: <p>In plain JavaScript, consider the following: You want to have an object that has its own rendering method, and inside the rendering is a button that is to call another of the object’s functions.</p>
  <p>As a basic example:</p>
  <pre class="lang-js prettyprint-override"><code>class Person () {
      //...
  
      incrementAge() { this.age++ }
  
      render() {
          return &quot;&lt;button onClick='this.incrementAge()'&gt;Age += 1&lt;/button&gt;&quot;
      }
  }
  </code></pre>
  <p>Now, as you probably realize, this button will fail because <code>this</code> refers to the click event now, and not the object itself.</p>
  <p><strong>Question</strong></p>
  <p>What’s the solution to making this button call the object’s function?</p>