Nodejs Array Union union(a)

Here you can find the source of union(a)

Method Source Code

// These are super slow, but they're being applied to arrays of length <= 6.
Array.prototype.union = function(a) {
    return this.concat(a.remove(this));
}

Related

  1. union(a, b)
    Array.union = function(a, b){
         return a.concat(b).uniquelize();
    };
    
  2. union(arr)
    Array.prototype.union = function (arr) {
      return this.concat(arr).distinct();
    };
    
  3. union(ary)
    Array.prototype.union = function (ary) {
        return this.concat(ary).distinct();
    };
    
  4. union(b)
    Array.prototype.union = function(b) {
      return this.concat(b).uniquelize();
    };