title: Array of email objects in Javascript
body: <p>I need to use an array of emails whose each record should point to several attributes like <code>To</code>, <code>From</code>, and <code>Subject</code>. I did something like this:</p>
  
  <pre><code>var emailAttr = new Array("to","from","subject");
  var emails = new Array(emailAttr);
  emails[0].to = "abc1";
  emails[1].to = "abc2"; // This line gives exception that emails[1] is undefined
  </code></pre>
  
  <p>What am i missing and how can i make it work so that I can access elements like <code>emails[i].to</code> ?</p>