title: How to set a String as a key for an object?
body: <p>Given</p>
  <pre><code>this.state = {email: &quot;something&quot;, firstName: &quot;something&quot; }
  const name = &quot;email&quot;
  const value = this.state[name]
  </code></pre>
  <p>I want to make a new object like this</p>
  <pre><code>{email: &quot;something&quot;}
  </code></pre>
  <p>basically without the other stuff</p>
  <p>I tried</p>
  <pre><code>const new = {name: value}
  </code></pre>
  <p>This makes it {name: &quot;something&quot;} I want {email: &quot;something&quot;}</p>
  <p>but the key doesn't attach to a variable and I want email to not be known to me</p>