title: Dynamic Property of JavaScript object?
body: <p>I am wondering if this is possible in JavaScript, I want to have an Object which could contain dynamic properties. </p>
  
  <p>Give an example: </p>
  
  <pre><code>function MyObject()
  {
  }
  
  var myobj = new MyObject();
  myobj.property1 = "something";
  
  alert(myobj.property1); // something
  alert(myobj.property2); // this should never report error, instead the property should be evaluated to null, as it has never been set. 
  </code></pre>
  
  <p>Is there any way to intercept property calls in JavaScript so I can proactively set a no-value property as null? </p>
  
  <p>Thanks.</p>