1.0.3 • Published 5 years ago

union-busting v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

Union Busting

Pass in any number of sets and this package will create a new set containing the union of those sets and then throws all of that away and returns null.

Source Code

module.exports = function(...sets) {

    // create a union
    let union = new Set();
    for( let set of sets ) {
        for( let value of set ) {
            union.add(value);
        }
    }

    // bust the union
    union = null;

    return union;
};

Installation

npm install union-busting

Usage

const unionBusting = require("union-busting");

unionBusting();
// returns null

let firstSet = new Set([1,2,3]);
let secondSet = new Set([4,5,6]);

unionBusting(firstSet, secondSet);
// returns null

let thirdSet = new Set([7,8,9]);

unionBusting(firstSet, secondSet, thirdSet);
// returns null
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago