Permutation library for JavaScript. See docs. Parent is js-algorithms.
⚠️ Depending on your environment, the code may requireregeneratorRuntime
to be defined, for instance by importing regenerator-runtime/runtime.
import { next , reversed , identity } from '@combinatorics/permutation' ;
next( reversed( identity( 3 ) ) ) ; // [ 0 , 1 , 2 ]