title: add element to array with string key in jquery
body: <p>I had already functioning code.
  Some part of the code should change two values of queryParams array:</p>
  
  <pre><code>myParam1 = 'sort_by';
  myParam2 = 'sort_order';
  queryParams[myParam1] = 'title';
  if (queryParams[myParam2] == 'ASC') {
      queryParams[myParam2] = 'DESC';
  } else { //DESC or undefined
      queryParams[myParam2] = 'ASC';
  }
  queryPairs = [];
  for (var index in queryParams) {
      queryPairs.push(index + "=" + queryParams[index]);
  }
  </code></pre>
  
  <p>Unfourtunately some logic has changed and now sometimes <code>queryParams</code> has length 0 at the beginning of this script and then this part failes.</p>
  
  <pre><code>queryParams[myParam1] = 'title';
  </code></pre>
  
  <p>and </p>
  
  <pre><code>queryParams[myParam2] = 'DESC'
  </code></pre>
  
  <p>lines do not change queryParams.length,so the length is still 0 and the loop </p>
  
  <pre><code>for (var index in queryParams){
  </code></pre>
  
  <p>do not work as expected.</p>
  
  <p>I have not found how to add key/value into the array.</p>