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

    @extra-set/symmetric-difference-update
    TypeScript icon, indicating that this package has built-in type declarations

    2.2.11 • Public • Published

    Gives values not present in both sets. 📦 😺 🏃 📼 🌔 📜 📰 📘

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

    This is part of package extra-set.


    set.symmetricDifference$(x, y);
    // x: a set (updated)
    // y: another set
    // → x
    const set = require("extra-set");
    
    var x = new Set([1, 2, 3, 4]);
    var y = new Set([3, 4, 5, 6]);
    set.symmetricDifference$(x, y);
    // Set(4) { 1, 2, 5, 6 }
    
    x;
    // Set(4) { 1, 2, 5, 6 }
    
    var x = new Set([1, 2, 3, 4]);
    var y = new Set([4, 5, 6]);
    set.symmetricDifference$(x, y);
    // Set(5) { 1, 2, 3, 5, 6 }


    References

    Install

    npm i @extra-set/symmetric-difference-update

    DownloadsWeekly Downloads

    4

    Version

    2.2.11

    License

    MIT

    Unpacked Size

    5.83 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar