just-permutations
TypeScript icon, indicating that this package has built-in type declarations

2.2.1 • Public • Published

just-permutations

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-permutations
yarn add just-permutations

Returns all permutations of the length N of the elements of the given Array

import permutations from 'just-array-permutations;

permutations([1, 2, 3]); // [[1, 2, 3], [2, 1, 3], [2, 3, 1], [1, 3, 2], [3, 1, 2], [3, 2, 1]]
permutations([]); // []
permutations(); // throws

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i just-permutations

      Weekly Downloads

      739

      Version

      2.2.1

      License

      MIT

      Unpacked Size

      5.56 kB

      Total Files

      9

      Last publish

      Collaborators

      • angus-c