Skip to content

Instantly share code, notes, and snippets.

@vjnrv
Created July 19, 2010 11:59
Show Gist options
  • Save vjnrv/481311 to your computer and use it in GitHub Desktop.
Save vjnrv/481311 to your computer and use it in GitHub Desktop.
/**
* Faz a comparação entre a lista de friends antiga e a nova.
* Se algum item da lista antiga não estiver na nova é Unfollow!
* @return unfollows {Array}
*/
function unfollowCheck( friendsOld, friendsNew )
{
if( friendsOld )
{
var unfollows = [];
for( var i = 0, n = 0, item; item = friendsOld[i]; i++ )
{
if( !inArray( friendsNew, item ) )
{
unfollows[n] = item;
n++;
}
}
return unfollows;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment