Javascript Array removeDuplicates()

Description

Javascript Array removeDuplicates()


Array.prototype.removeDuplicates = function() {
    var array = this;
    return array.filter(function(elem, pos) {
        return array.indexOf(elem) == pos;
    })/*  w  ww .  java 2  s .  c o m*/
};



PreviousNext

Related