title: How to add multiple objects to an array
body: <p>why the value of a[0].nil is 400. what should i do to set it to 200. thanks for the answer</p>
  
  <pre><code>a = new Array();
  x = new Object();
  str = "nil";
  
  x[str] = 200;
  
  a.push(x);
  
  x[str] = 400;
  
  a.push(x);
  
  alert("1 = "+ a[0].nil);
  alert("2 = "+ a[1].nil);
  </code></pre>