title: Javascript Arrays - Specify Key
body: <p>Is it possible to create a javascript array similar to PHP's method which allows you to define the keys during creation?</p>
  
  <pre><code>$arr = array("foo" =&gt; "bar", 12 =&gt; true);
  </code></pre>
  
  <p>Or can this only be done like:</p>
  
  <pre><code>myArray["foo"] = "bar";
  myArray[12] = true;
  </code></pre>