Getting Object Name from inside the Class (JavaScript)
<p>I have a class and I want from inside the class to save as a class variable the name of the object using the class:</p>

<pre><code>var xxx = new MyClass(); // on the constructor this.name should be init to "xxx"
</code></pre>

<p>Ive already tried this approach:</p>

<blockquote>
  <p><a href="http://stackoverflow.com/questions/789675/how-to-get-class-objects-name-as-a-string-in-javascript">How to get class object&#39;s name as a string in Javascript?</a></p>
</blockquote>

<p>But I can't get it work from the class constructor itself.</p>
