title: If value is in multidimensional array
body: <p>I'm having a problem with my <code>$.getJSON</code> function, first I store all my friends in a array like this:</p>
  
  <pre><code>var friends = [];
  friends.push({
      user: {
          username: value.username,
          uuid: value.uuid,
          accepted: value.accepted,
          sent: value.sent
      }
  });
  </code></pre>
  
  <p>This get's it's data from a <code>$.getJSON</code> function and works fine.</p>
  
  <p>Then I have a search function, where I search for a username from my database like this:</p>
  
  <pre><code>$(document).on('keyup', '.search', function() {
          $.getJSON('url?username='+$(this).val(), function(data){
              $.each(data, function(index, value){
                  friends.filter(function (friend) {
                      if(friend.user.username == value.username){
                         //Append custom
                      } else {
                          //append data from JSON
                      }
                  });
              });
          });
      });
  </code></pre>
  
  <p>If friends array have a object, this works fine. But if it's empty, nothing happends, it does not append anything. </p>
  
  <p>What's wrong here? Any help is appreciated</p>