title: Push to array a key name taken from variable
body: <p>I have an array:</p>
  
  <pre><code>var pages = new Array();
  </code></pre>
  
  <p>I want to push my pages data to this array like this:</p>
  
  <pre><code>$('li.page').each(function () {
          var datatype = $(this).attr('data-type');
          var info = $(this).attr('data-info');
          pages_order.push({datatype:info});
      });
  </code></pre>
  
  <p>but this code doesn't replace <code>datatype</code> as variable, just puts datatype string as a key.
  How do I make it place there actual string value as a key name?</p>