javascript:arrays:array_diff
JavaScript - Arrays - Array Diff
var difference = function(compare){ return Array.from(arguments).reduce(function(previous, current){ return previous.filter(function(element){ return current.indexOf(element) == -1; }); }); };
NOTE: You can also use a reusable component called array-diff:
diff([1,2,3], [1,2,3,4,5]) // => [4,5]
javascript/arrays/array_diff.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1