creating object with dynamic name JS
<p>How can I accomplish this task:</p>

<pre><code>var i = 'foo';
var x = {
          i: 'bar'
        }
console.log(x);
&gt; {'foo':'bar'};
</code></pre>

<p>thanks!</p>
