var combinations = require('combinations');
var arr = ['red', 'orange', 'yellow', 'green'];
combinations(arr, 2, 2)
Yields 12 combinations, including some that have 3 elements. Was expecting an array of size 6, with each result having exactly 2 elements.