title: What does this javascript response function do?
body: <p>I saw this code in another SO post: <a href="https://stackoverflow.com/questions/3764146/jquery-ui-autocomplete-with-asp-mvc">jQuery UI Autocomplete with ASP MVC</a></p>
  
  <pre><code>    $("#CustomerID").autocomplete({
          source: function(request, response) {
              $.ajax({
                  type: "POST",
                  url: "/customer/search",
                  dataType: "json",
                  data: {
                      term: request.term
                  },
                  error: function(xhr, textStatus, errorThrown) {
                      alert('Error: ' + xhr.responseText);
                  },
                  success: function(data) {
                      response($.map(data, function(c) {
                          return {
                              label: c.Company,
                              value: c.ID
                          }
                      }));
                  }
              });
          },
          minLength: 2,
          select: function(event, ui) {
              alert('Select');
          }
      });
  </code></pre>
  
  <p>I understand everything except the success function. I know that map is taking an array and mapping each value to a new object that has a label and value property and returning the new array, but I am not sure what response() does.</p>