Variable as the property name in a JavaScript object literal?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/695050/how-do-i-add-a-property-to-a-javascript-object-using-a-variable-as-the-name">How do I add a property to a Javascript Object using a variable as the name?</a><br>
  <a href="http://stackoverflow.com/questions/7638659/use-variable-for-property-name-in-javascript-literal">Use variable for property name in JavaScript literal?</a>  </p>
</blockquote>



<p>Is it possible to add a variable as the property name of an object in JavaScript, like the following:</p>

<pre><code>var myVar = "name";
var object = {
    {myVar}: "value"
};
</code></pre>
