power set, combination, permutation and more in JavaScript