title: Empty array when "push" is used inside $.post function
body: <p>I would like to ".push" the  result of "$.post" into an array.</p>
  
  <p>I've tried the following code, but in appears that <code>cats.push(data);</code> doesn't work inside the <code>$.post</code> function, I can confirm with <code>alert(data);</code> that data variable is not empty but at the end the "cats" array is empty</p>
  
  <pre><code>        $('[id^="mul-"]').click(function () {
                  cats = [];
                  $(this).toggleClass('selected');
                  $(".selected").each(function(){
  
                      $.post( "/index.php?do=getcatname&amp;id=" + this.id.slice().replace(/mul-/,''), function( data ) {
                          cats.push(data);
                          alert(data);
                      });
                  });
  
                  ms = cats.join(",");
                  alert(ms);
          });
  </code></pre>