title: Error while setting the value of a global private class property in javascript
body: <p>I have a code in which I declare a private class member using &quot;#&quot; and then initialize it in the constructor and then when I try to set / access the value I get the following error</p>
  <pre><code>Uncaught TypeError: Cannot read private member #mouse from an object whose class did not declare it
      at mouseDownEvent
  </code></pre>
  <p>where the <strong>mouseDownEvent</strong> is the function, where I try to access the values</p>
  <p>code example: ( refer to the <strong>EDIT</strong> code )</p>
  <pre><code>class Testing
  {
     #property;
     constructor()
     {
        this.#property = new Vector2();
     }
  
     mouseDownEvent()
     {
        this.#mouse.x = somevalue; &lt;- error is here
     }
  }
  </code></pre>
  <p><strong>EDIT</strong></p>
  <pre><code>class Testing
  {
     #mouse;
     constructor()
     {
        this.#mouse= new Vector2();
     }
  
     mouseDownEvent()
     {
        this.#mouse.x = somevalue; &lt;- error is here
     }
  }
  </code></pre>