title: jQuery UI Autocomplete: return "nothing found" when no search matches occur
body: <p>Newbie coder here. I have a search bar with jQuery autocomplete, searching through a local json array. When no matches are found, I want to return a string that says "Nothing found."</p>
  
  <p>I've tried if statements inside $.grep but nothing has worked so far:</p>
  
  <pre><code>$("#div_name").autocomplete({
    appendTo: ".custom-autocomplete",
    source: function (request, response) {
    var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");
    response($.grep(array, function(value) {
  
    var not_found = 'Nothing found.';
  
       if (matcher.test(value.value).length &amp;&amp; matcher.test(value.nickname).length == 0) {
         return not_found;
       }
       else {
      return matcher.test(value.value)
         || matcher.test(value.nickname);
    }
  
    }));
  },
  </code></pre>
  
  <p>Thanks for your help!! :)</p>