var usersArray = []; var username; $.each(data.data, function(index, e) { if(username != e.user.username) { username = e.user.username; usersArray.push( e.user ); } });