Nodejs Array Different diff( a )

Here you can find the source of diff( a )

Method Source Code

/*  //from  w w  w  .j av a 2 s. c o  m
 *  Array prototype additions
 */

Array.prototype.diff = function( a ) {
    return this.filter( function( i ) { return !( a.indexOf( i ) > -1 ); } );
};

Related

  1. diff
    Array.prototype.diff =
      function(otherArray) [ i for each( i in this ) if( !otherArray.has( i ) ) ];
    
  2. diff(B)
    Array.prototype.diff = function (B) {
        return this.filter(function (a) { return B.indexOf(a) < 0; });
    };
    
  3. diff(a)
    Array.prototype.diff = function(a) {
        return this.filter(function(i) {return a.indexOf(i) < 0;});
    };
    
  4. diff(a)
    Array.prototype.diff = function (a) {
        return this.filter(function (e) { return a.indexOf(e) === -1 });
    };
    
  5. diff(a)
    module.exports = {
        findMissing :function (a,b){
                if(a.length === b.length) return 0;
                if(a.length < b.length) return b.diff(a)[0];
                return a.diff(b)[0];
    };
    Array.prototype.diff = function(a) {
        return this.filter(function(i) {return a.indexOf(i) < 0;});
    ...