@extra-map/difference-update

Gives entries of map not present in another.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@extra-map/difference-update
322.2.152 years ago3 years agoMinified + gzip package size for @extra-map/difference-update 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 (updated)
// y: another map
// → x

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 }

x;
// Map(3) { "a" => 1, "c" => 3, "e" => 5 }

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 }



References