union-busting

1.0.3 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i union-busting

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

1.65 kB

Total Files

4

Last publish

Collaborators

  • jegofujuho