function getCombinations(arr, selectNumber) {
if (selectNumber === 1) return arr.map((x) => [x])
const results = []
arr.forEach((fixed, index, origin) => {
const rest = origin.slice(index + 1)
const combinations = getCombinations(rest, selectNumber - 1)
const attached = combinations.map((x) => [fixed, ...x])
results.push(...attached)
})
return results
}