Nodejs Utililty Methods Array Complement

List of utility methods to do Array Complement

Description

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

Method

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; 
...
complement(a, b)
Array.complement = function(a, b){
     return Array.minus(Array.union(a, b),Array.intersect(a, b));
};
complement(b)
Array.prototype.complement = function(b) {
  return a.minus(a.union(b), a.intersect(b));
};