function getAllCombination ( list ) {
var len = list.length,
binaryList = Array(len+1).join(0).split('');
var result = [], pos, resultStep;
while ( true ) {
pos = 0;
resultStep = [];
while ( binaryList[ pos ] ) {
binaryList[ pos ] = 0;
pos++;
}
if ( pos == len ) { break; }
binaryList[ pos ] = 1;
for ( var j = len; j--; ) {
if ( binaryList[j] ) {
resultStep[ resultStep.length ] = list[j];
}
}
result[ result.length ] = resultStep.sort();
}
return result;
}
getAllCombination( [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] );