Skip to content

Instantly share code, notes, and snippets.

View thomasam97's full-sized avatar

Thomas thomasam97

  • Stuttgart, DE
View GitHub Profile
@textarcana
textarcana / array-permutation.js
Last active May 20, 2020 12:52
Array permutation
/*jslint sloppy:true, white:true, vars:true, plusplus:true */
var permutation = function (collection){
var current,
subarray,
result = [],
currentArray = [],
newResultArray = [];
if (collection.length){