title: Create associative array on Jqueries each loop
body: <p>I try to create a new object with jquery each but only the last element of my looped is getting added to my object</p>
  
  <pre><code>var selectArray ={}; 
      $.each(response, function( i, x ){
            selectArray['id'] = x.id;
            selectArray['text'] = x.name;                            
      });
   console.log(selectArray);
  </code></pre>