title: undefined object in map collection javascript
body: <p>I have my custom class and I want to store it into map collection, but while I want to get one of the value from the map (one instance of my object) I got error that object is undefined. Is there any possibility to cast object or something? If I push simple string instead of object of my custom class everything is ok. Someone can tell me how to solve this problem? Of course if this problem could be solved.</p>
  <p>js:</p>
  <pre><code>function CustomClass(first, second, third){
      this.one = first;
      this.two = second;
      this.three = third;
  }
  
  CustomClass.prototype.constains(obj1, obj2){}
  
  ...
  var dictionary = new Object();
  dictionary[key] = CustomClass(1, &quot;lel&quot;, 2);
  for(var el in dictionary) //here IE debugger shows that I have a right key, but the value is undefined.
  {
      if(dictionary[el].contains(something))
      {...}
  }
  </code></pre>
  <p>If it depends I use IE10. Thanks for help and also for tips!</p>
  <h1>edit:</h1>
  <p>If I use</p>
  <pre><code>dictionary[key] = new CustomClass(1, &quot;lel&quot;, 2);
  </code></pre>
  <p>instead of:</p>
  <pre><code>dictionary[key] = CustomClass(1, &quot;lel&quot;, 2);
  </code></pre>
  <p>it works, but someone could tell me why, something like this:</p>
  <pre><code>dictionary[key] = &quot;lel&quot;; 
  </code></pre>
  <p>works without new operator? From what I know everything in js is an object so what's the difference beetwen inserting a string and a custom class? (I'm new in js, so sorry for my bad knowledge)</p>