Hello @acarl005. The fact that your functions need this to function has this somewhat uncomfortable side-effect that you cannot use them without calling them from the generatorics object.
Here is what I mean:
// If you do the following for instance:
var combination = require('generatorics').combination;
// This will throw & fail because the function does not have the required scope
combination([1, 2, 3], 2);
A solution would be to bind your function to the correct scope before exporting or rewrite the code marginally not to rely on the scope of the generatorics object.
Hello @acarl005. The fact that your functions need
thisto function has this somewhat uncomfortable side-effect that you cannot use them without calling them from the generatorics object.Here is what I mean:
A solution would be to bind your function to the correct scope before exporting or rewrite the code marginally not to rely on the scope of the generatorics object.