Create a Dynamic Hash JavaScript with unique Key
<p>I am trying to create some dynamic hashes in Javascript</p>

<p>I have </p>

<pre><code>Postcodes = ["one", "two"]
</code></pre>

<p>From this I am trying to create a hash with the key of the hash being the value from the array.</p>

<pre><code>postcode_1 = Postcodes[0]
postcode_2 = Postcodes[1]
postcode1 = {}
postcode2 = {}
postcode1[postcode_1] = {foo: 1200, bar: "woo"};
postcode2[postcode_2] = {foo: 1200, bar: "woo"};
</code></pre>

<p>This does not work what I need to end up with is a hash that looks like this</p>

<pre><code>{"one": {foo: 1200, bar: "woo"}
</code></pre>
