Skip to content

Instantly share code, notes, and snippets.

@thalesmello
Created July 29, 2014 21:04
Show Gist options
  • Save thalesmello/d6f2083dd53a4b340613 to your computer and use it in GitHub Desktop.
Save thalesmello/d6f2083dd53a4b340613 to your computer and use it in GitHub Desktop.
google spreadsheets difference
function difference(old_one, new_one){
var difference = [];
new_one.forEach(function(new_el){
var common = false;
old_one.forEach(function(old_el){
if(old_el[0] === new_el[0]){
common = true;
}
});
if(!common){
difference.push(new_el);
}
});
Logger.log(difference);
return difference;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment