title: jquery push the key and value into array
body: <p>I have the initial array in the following way:</p>
  
  <pre><code>var bankNamesList = [{
      'BARODA': 'BARODA'
  }, {
      'AB': 'AB'
  }];
  </code></pre>
  
  <p>Then i am looping the values and appended to main variable and constructing a drop-down</p>
  
  <pre><code>var bankNames = '&lt;ul class="root" id="exp-bank-names"&gt;';
  $.each(bankNamesList, function() {
      $.each(this, function(name, value) {
          bankNames += '&lt;li&gt;&lt;a href="#" name="' + name + '"&gt;' + value + '&lt;/a&gt;&lt;/li&gt;';
      });
  });
  bankNames += '&lt;/ul&gt;';
  $('.submenu-bank-list').html(bankNames);
  </code></pre>
  
  <p>How do i push the new value in to an array.</p>
  
  <p>i tried in the following way, but no luck.</p>
  
  <pre><code>var nameAttr = 'SBI';    
  bankNamesList.push({nameAttr:nameAttr});
  </code></pre>