Nodejs Utililty Methods Array Remove Duplicate

List of utility methods to do Array Remove Duplicate

Description

The list of methods to do Array Remove Duplicate are organized into topic(s).

Method

remove_duplicates()
Array.prototype.remove_duplicates = function() {
    var seen = [];
    for (var i = this.length; --i >= 0;) {
        var el = this[i];
        if (seen.contains(el)) this.splice(i, 1);
        seen.push(el);
    return this;
};
...
removeElement(search, func)
Array.prototype.removeElement = function(search, func){
  var index = this.indexOfElement(search, func);
  if(index != -1) {
    var remove = this.splice(index, 1);
    return remove[0];
  return null;