Skip to content

exromany/combinations-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Combinations-generator

Return combinations in array uses es6 generators.

Install

npm install combinations-generator

To use this package you must be running node 0.11 for generator support, and must run node with the --harmony flag.

Example

var comb = require("combinations-generator")

var array = ["a", "b", "c"]

var iterator = comb(array, 2);

for (var item of iterator) {
  console.log(item);
}

Output:

[ 'a', 'b' ]
[ 'a', 'c' ]
[ 'b', 'c' ]

If you want to use this in a browser, then you should use browserify.

Credits

(c) 2015 exromany. MIT License

About

find combinations uses es6 generators

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published