@bannon/powerset
v1.0.0
Published
A JavaScript implementation of calculating the powerset of a given array
Readme
Powerset
A JavaScript implementation of calculating the powerset of a given array
Installation
$ npm install @bannon/powersetUsage
This function can be called in multiple ways:
As an array
powerset(['a', 'b', 'c'])As a string of characters
powerset('abc')As function arguments
powerset('a', 'b', 'c')These will all return the same result:
/*
[
[],
["a"],
["b"],
["c"],
["a", "b"],
["b", "c"],
["a", "c"],
["a", "b", "c"]
]
*/