title: How can I append values from an Ajax response to an array in JavaScript?
body: <p>Before my Ajax function is called, I have a global scoped <code>names</code> array like this:</p>
  
  <pre><code>var names =  ["John Smith","Mike Jones","Jenny White","April Brown"];
  </code></pre>
  
  <p>In the <code>success</code> function of the ajax call I need to erase the array and repopulate it with new names passed back to the page in Json format (<code>v.name</code> in the example below).</p>
  
  <p>But I'm not sure how to append to the array in the course of my <code>$.each</code> loop:</p>
  
  <pre><code>$.each(data, function() {
    $.each(this, function(k, v) {
  
        // how to add `v.name` to the `names` array?
  
    });
  });
  </code></pre>