https://bb.viegg.com/p/10 4年后的改良版:
const ps = arr => Array(2 ** arr.length).fill(0).map((_, n) => arr.filter((_, i) => (n >> i) % 2))