Small package that iterates an array and returns all ordering combinations.
import combinations from '@trenskow/combinations';
combinations([1, 2, 3])
/*
-> [
[],
[ 1 ],
[ 1, 2 ],
[ 1, 2, 3 ],
[ 1, 3 ],
[ 1, 3, 2 ],
[ 2 ],
[ 2, 1 ],
[ 2, 1, 3 ],
[ 2, 3 ],
[ 2, 3, 1 ],
[ 3 ],
[ 3, 1 ],
[ 3, 1, 2 ],
[ 3, 2 ],
[ 3, 2, 1 ]
]
*/See license in LICENSE