1.0.0 • Published 6 years ago

enum-all v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

enum-all

enumerate all the elments in a given array for given capacity

Build Status

Usage

Example

  //generate all 3 letter string using numbers between 1 and 5
  var enumAll = require('enum-all')
  
  var arr = ['1','2','3','4','5']
  var capacity = 3

  //result is an array containing all possible combinations
  var result = enumAll(arr, capacity) 
  console.log(result)

API

require('enum-all')(arr, capacity)

returns an array containing all combinations of elements in an array arr for given capacity

License

MIT