In JavaScript how can I use a function parameter as the key to an object?
<p>For example the following code prints </p>

<blockquote>
  <p>{ key: 'b' }</p>
</blockquote>

<pre><code>function myFunc(key, value) {
    myFunc2({key: value});
}

function myFunc2(obj) {
    console.log(obj);
}

myFunc('a', 'b');
</code></pre>

<p>How would I get it to print </p>

<blockquote>
  <p>{ 'a': 'b' }</p>
</blockquote>
