Skip to content

Instantly share code, notes, and snippets.

@sahat
Created November 10, 2012 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sahat/4049901 to your computer and use it in GitHub Desktop.
Save sahat/4049901 to your computer and use it in GitHub Desktop.
function games_union (arr1, arr2) {
var union = arr1.concat(arr2);
for (var i = 0; i < union.length; i++) {
for (var j = i+1; j < union.length; j++) {
if (are_games_equal(union[i], union[j])) {
union.splice(i, 1);
console.log(union[i]);
}
}
}
}
function are_games_equal(g1, g2)
{
return g1.title === g2.title;
}
console.log(games_union(temp, temp2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment