Skip to content

Instantly share code, notes, and snippets.

@adyngom
Created April 24, 2019 16:56
Show Gist options
  • Save adyngom/b12afcf7cc20d5ff923d0eda715824a7 to your computer and use it in GitHub Desktop.
Save adyngom/b12afcf7cc20d5ff923d0eda715824a7 to your computer and use it in GitHub Desktop.
if(!Array.prototype.uniq) {
Array.prototype.uniq = function() {
return this.reduce( (arr, val) => {
if (!arr.includes(val)) arr.push(val);
return arr;
}, [] )
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment