async-chainable-cartesian
Plugin for async-chainable to provide Cartesian iteration (all combinations of multiple arrays).
API
product([sets...], callback)
Execute a callback for all permutations of sets.
var asyncChainable = ;var asyncChainableCartesian = ; var a = 'foo' 'bar' 'baz';var b = 'alpha' 'beta' 'gamma'; producta b { console; ; } ;
See the test kit for more examples.
compare(set, callback)
Execute a callback for all permutations of items within one set.
Unlike product()
this function assumes that the result is symmetric - i.e. comparing set[0]
to set[1]
would return the same result as comparing set[1]
to set[0]
. This allows the function to optimize and make fewer loops than product()
as the number of comparisons decreases for each item rather than remaining linear as with product()
.
;
See the test kit for more examples.