Skip to content

A simple method to create an array of all the possible combinations when passing in an array of arrays.

Notifications You must be signed in to change notification settings

lbrevity/jQuery-Combinations-Plugin

 
 

Repository files navigation

jQuery Combinations Plugin

http://bigab.github.com/jQuery-Combinations-Plugin

Version: 1.0, Last updated: 29/10/2010

jQuery Combinations Plugin is a simple utility method used to create an array of every possible combination derived from an array of arrays.

Documentation

So simple:

Pass an array of arrays to the combinations method:

$.combinations([[1,2], ["A", "B", "C"]]);

...and it returns an array of the combinations between the arrays:

returns `[[1,"A"], [2,"A"], [1,"B"], [2,"B"], [1,"C"], [2,"C"]]`

Browsers Tested

Internet Explorer 8-9, Firefox 7, Chrome 15

Unit Tests

QUnit

License

Copyright (c) 2011 "BigAB" Adam Barrett licensed under the MIT license. http://bigab.mit-license.org/

About

A simple method to create an array of all the possible combinations when passing in an array of arrays.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 90.2%
  • CSS 8.1%
  • HTML 1.7%