@extra-map/difference

Gives entries of map not present in another.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@extra-map/difference
312.2.152 years ago2 years agoMinified + gzip package size for @extra-map/difference in KB

Readme

Gives entries of map not present in another. :package: :smileycat: :running: :vhs: :moon: :scroll: :newspaper: :bluebook:
Alternatives: difference, difference$.
Similar: union, intersection, difference, symmetricDifference, isDisjoint.

This is part of package extra-map.



map.difference(x, y);
// x: a map
// y: another map

const map = require("extra-map");

var x = new Map([["a", 1], ["b", 2], ["c", 3], ["d", 4], ["e", 5]]);
var y = new Map([["b", 2], ["d", 4]]);
map.difference(x, y);
// Map(3) { "a" => 1, "c" => 3, "e" => 5 }

var y = new Map([["b", -2], ["d", -4]]);
map.difference(x, y);
// Map(3) { "a" => 1, "c" => 3, "e" => 5 }



References