-
Notifications
You must be signed in to change notification settings - Fork 0
difference
Subhajit Sahu edited this page Dec 22, 2022
·
15 revisions
Obtain ientries not present in another ientries.
Similar: union, intersection, difference, symmetricDifference, isDisjoint.
function difference(x, y)
// x: ientries
// y: another ientries
const ientries = require('extra-ientries');
var x = [["a", 1], ["b", 2], ["c", 3], ["d", 4], ["e", 5]];
var y = [["b", 2], ["d", 4]];
[...ientries.difference(x, y)];
// → [ [ "a", 1 ], [ "c", 3 ], [ "e", 5 ] ]
var y = [["b", -2], ["d", -4]];
[...ientries.difference(x, y)];
// → [ [ "a", 1 ], [ "c", 3 ], [ "e", 5 ] ]