Powerset operator for JavaScript. See docs.
⚠️ Depending on your environment, the code may requireregeneratorRuntime
to be defined, for instance by importing regenerator-runtime/runtime.
import {count} from '@iterable-iterator/count';
import {powerset as subsets} from '@set-theory/powerset';
const naturalNumbers = count(0n, 1n);
for (const subset of subsets(naturalNumbers)) ... ;