title: Create array from Ajax POST Request
body: <p>I am using this code to create an array using an Ajax Post request.</p>
  
  <pre><code>$('#accountholderEmail').on('keyup',function() {
          $.ajax({
              type: "POST",
              url: "/section/get_data?getCustomer=1", 
              cache: false, 
              success: function(data){
                  var email_array = data;
              }
          });
          console.log(email_array);
  });
  </code></pre>
  
  <p><code>data</code> from the Ajax request is returning an array but its telling me that email_array is not defined in the <code>console.log(email_array);</code></p>
  
  <p>How can i get this variable populated with the returned data from the ajax request</p>