Skip to content

Instantly share code, notes, and snippets.

@che-wf
Last active July 22, 2016 17:11
Show Gist options
  • Select an option

  • Save che-wf/d912ff483064c1c38136 to your computer and use it in GitHub Desktop.

Select an option

Save che-wf/d912ff483064c1c38136 to your computer and use it in GitHub Desktop.
Angular Find Duplicates in Array
Array.prototype.findDupes = function () {
return this.reduce(function (accum, current) {
if (angular.lowercase(accum).indexOf(
angular.lowercase(current)) < 0) {
accum.push(angular.lowercase(current));
}
return accum;
}, []);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment