Javascript expression to define object's property name?
<p>I'd like to create this object...</p>

<pre><code>object = {
  'object[1][var_name_1]' : 'value1',
  'object[1][var_name_2]' : 'value2',
};
</code></pre>

<p>I'm trying to it this way, but I'm getting error <strong>missing : after property id</strong>...</p>

<pre><code>function getPrefix() {
  return 'object[1]';
}

object = {
  getPrefix() + '[var_name_1]' : 'value1',
  getPrefix() + '[var_name_2]' : 'value2',
}
</code></pre>

<p>What am I doing wrong? Or maybbe it is impossible to set object property name using js experession?</p>

<p>Thank you</p>
