title: Push an object with a variable as a property name onto an array
body: <p>I have a javascript array and a variable. I want to push onto the array an object with the variable as the property name, but it must hold the value of the variable, not the variable as a string.
  If I have this code:</p>
  
  <pre><code>array = [];
  var x = 10;
  array.push({x: y});
  </code></pre>
  
  <p>The x is stored as a string "x", not a variable that contains the value of var x.
  Any help is appreciated.</p>