Skip to content
π“Ÿβ„―π“‡π‘šπ“Šπ“‰π’Άπ“‰β„―π’Ή: get all available combinations
JavaScript TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
.editorconfig
.gitattributes add typedefinitions Jul 26, 2019
.gitignore
.npmrc add typedefinitions Jul 26, 2019
.travis.yml
index.d.ts add typedefinitions Jul 26, 2019
index.js
index.test-d.ts
license add typedefinitions Jul 26, 2019
package.json
readme.md
test.js

readme.md


π“Ÿβ„―π“‡π‘šπ“Šπ“‰π’Άπ“‰β„―π’Ή

Get all available combinations


In mathematics, permutation is the act of arranging the members of a set into a sequence or order, or, if the set is already ordered, rearranging (reordering) its elements a process called permuting. Permutations differ from combinations, which are selections of some members of a set regardless of order.

Read More...

Complexity?

7 letters word ~> 7! ~> 5040 available combinations to generate.

Important

This module uses Array.prototype.flat() that was introduced on Node.js 11+. You can still use the previus version (1.0.1) of permutated.

Install

$ npm install permutated

Usage

const permutated = require('permutated');

permutated('abc'));
//=> [ 'abc', 'acb', 'bac', 'bca', 'cab', 'cba' ]

permutated.numberOfPermutations('1234567'));
//=> 5040

API

permutated(word)

Return type: string[] | string

Return all the permuations available from a string.

word

Type: string

The string to permutate.

numberOfPermutations(word)

Return Type: number

Get the number of permuations avilable in a string.

word

Type: string

The string to permutate.

Related

  • all-words: Generate all available words super fast

License

MIT Β© Carlos Abraham

You can’t perform that action at this time.