jussi-kalliokoski / trine

A utility library for modern JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

permutator

nikhedonia opened this issue · comments

implement a permutator which yields all permutations of a given list

for( permutation of [1,2,3]::permutate() ){
    console.log(permutation);
}

//would print [1,2,3] , [2,1,3] , [2,3,1], [3,2,1] , [3,1,2], [1,3,2] 

👍 - I'd also like to see other combinatorics from python's itertools in Trine.

me too; itertools is a nice source of inspiration