title: How to get class object's name as a string in Javascript?
body: <p>Let's say I instantiate an object in Javascript like this:</p>
  <pre><code>var myObj = new someObject();
  </code></pre>
  <p>Now, is it possible to obtain the var object's name as string <code>'myObj'</code> from within one of the class methods?</p>
  <hr />
  <h3>Additional details (edited):</h3>
  <p>The reason why I would like to get the name of the variable holding reference to the object is that my new <code>myObj</code> would create a new clickable <code>DIV</code> on the page that would need to call a function <code>myObj.someFunction()</code>. As I insert the new <code>DIV</code> I need to know the name of the variable holding reference to the object. Is there maybe a better way of doing this?</p>
  <hr />
  <p>You are right, sorry for the mixup in terminology.</p>
  <p>The reason why I would like to get the name of the variable holding reference to the object is that my new myObj would create a new clickable DIV on the page that would need to call a function myObj.someFunction(). As I insert the new DIV I need to know the name of the variable holding reference to the object. Is there maybe a better way of doing this?</p>