Nodejs Array Complement complement(b)

Here you can find the source of complement(b)

Method Source Code

Array.prototype.complement = function(b) {
   return a.minus(a.union(b), a.intersect(b));
};

Related

  1. complement()
    Array.prototype.each = function(fn){ 
    fn = fn || Function.K; 
    var a = []; 
    var args = Array.prototype.slice.call(arguments, 1); 
    for(var i = 0; i < this.length; i++){ 
        var res = fn.apply(this,[this[i],i].concat(args)); 
        if(res != null) a.push(res); 
    return a; 
    ...
    
  2. complement(a, b)
    Array.complement = function(a, b){
         return Array.minus(Array.union(a, b),Array.intersect(a, b));
    };