Returns a generator that yields all permutations of the input iterable.
WARNING: This loads the entire input iterable into memory, which can be unsafe
for large collections. For a safer version with constrained memory usage,
use combinations.ts.
Type Parameters
T
The type of elements in the iterable
Parameters
Optionalk: number
Optional length of each permutation (defaults to the length of the input)
Returns a generator that yields all permutations of the input iterable. WARNING: This loads the entire input iterable into memory, which can be unsafe for large collections. For a safer version with constrained memory usage, use combinations.ts.