Skip to content

Instantly share code, notes, and snippets.

@srkama
Created February 2, 2016 12:26
Show Gist options
  • Select an option

  • Save srkama/bd12917fd999b6c985db to your computer and use it in GitHub Desktop.

Select an option

Save srkama/bd12917fd999b6c985db to your computer and use it in GitHub Desktop.
unique elements in an array
function unite(arr1, arr2, arr3) {
return Array.prototype.slice.call(arguments).reduce(function(a,b) {
for(i=0;i<b.length;i++) {
if(a.indexOf(b[i])==-1) {
a.push(b[i])
}
}
return a;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment