Wspólne klucze dwóch tablic

statValueValue = [1,2,3];

valuesFromInput = [1,3];

let intersection = statValueValue.filter(function(i) {return valuesFromInput.indexOf(i) < 0;});

//lub
Array.prototype.diff = function(a) {
     return this.filter(function(i) {return a.indexOf(i) < 0;});
};

let intersection = statValueValue.diff( valuesFromInput );  
Komentarze wyłączone