title: Assigning property to JS object using another objects property value as the property name
body: <p>I want to use the value of an objects property to name the property of another object.  Easy to do in PHP:</p>
  
  <pre><code>$object1-&gt;property = 'name';
  $object2-&gt;{$object1-&gt;property} = "value";
  echo $object2-&gt;name; //outputs "value"
  </code></pre>
  
  <p>But in Javascript I can't figure out how to do this.  The curly braces are used a different way.</p>
  
  <p>Anyone know the php equivalent in javascript?</p>
  
  <p>Thanks :)</p>