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

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

    2.2.5 • Public • Published

    Gives entries not present in both objects. 🏃 📼 📦 🌔 📒

    Alternatives: symmetricDifference, symmetricDifference$.
    Similar: union, intersection, difference, symmetricDifference, isDisjoint.
    This is part of package extra-object.

    object.symmetricDifference(x, y);
    // x: an object
    // y: another object
    const object = require('extra-object');
    
    var x = {a: 1, b: 2, c: 3, d: 4};
    var y = {c: 30, d: 40, e: 50, f: 60};
    object.symmetricDifference(x, y);
    // { a: 1, b: 2, e: 50, f: 60 }
    
    var y = {d: 40, e: 50, f: 60};
    object.symmetricDifference(x, y);
    // { a: 1, b: 2, c: 3, e: 50, f: 60 }

    references

    Install

    npm i @extra-object/symmetric-difference

    DownloadsWeekly Downloads

    12

    Version

    2.2.5

    License

    MIT

    Unpacked Size

    7.19 kB

    Total Files

    14

    Last publish

    Collaborators

    • avatar