Obtain entries not present in another lists.
Similar: union, intersection, difference, symmetricDifference, isDisjoint.
function difference(x, y) // x: lists // y: another lists
const xlists = require('extra-lists'); var x = [['a', 'b', 'c', 'd', 'e'], [1, 2, 3, 4, 5]]; var y = [['b', 'd'], [2, 4]]; xlists.difference(x, y).map(c => [...c]); // → [ [ 'a', 'c', 'e' ], [ 1, 3, 5 ] ] var y = [['b', 'd'], [-2, -4]]; xlists.difference(x, y).map(c => [...c]); // → [ [ 'a', 'c', 'e' ], [ 1, 3, 5 ] ]
There was an error while loading. Please reload this page.