Have ideas to improve npm?Join in the discussion! »

    @extra-map/symmetric-difference.min
    TypeScript icon, indicating that this package has built-in type declarations

    2.2.15 • Public • Published

    Gives entries not present in both maps. 📦 😺 🏃 📼 🌔 📜 📰 📘

    Alternatives: symmetricDifference, symmetricDifference$.
    Similar: union, intersection, difference, symmetricDifference, isDisjoint.

    This is part of package extra-map.

    This is browserified, minified version of @extra-map/symmetric-difference.
    It is exported as global variable map_symmetricDifference.
    CDN: unpkg, jsDelivr.


    map.symmetricDifference(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]]);
    var y = new Map([["c", 30], ["d", 40], ["e", 50], ["f", 60]]);
    map.symmetricDifference(x, y);
    // Map(4) { "a" => 1, "b" => 2, "e" => 50, "f" => 60 }
    
    var y = new Map([["d", 40], ["e", 50], ["f", 60]]);
    map.symmetricDifference(x, y);
    // Map(5) { "a" => 1, "b" => 2, "c" => 3, "e" => 50, "f" => 60 }


    References

    Install

    npm i @extra-map/symmetric-difference.min

    DownloadsWeekly Downloads

    10

    Version

    2.2.15

    License

    MIT

    Unpacked Size

    6.44 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar