Say I have the nested array
gridInterFT=[[1,2],[2,3],[3,4],[1,3],[1,4],[2,4]]
How would I write a function that takes this array as input and returns a 3d nested array containing all possible permutations of the array? I.e. the returned array should look something like:
[[[1,2],[2,3],[3,4],[1,3],[1,4],[2,4]], [[1,3],[2,3],[3,4],[1,2],[1,4],[2,4]],
[[2,3],[1,2],[3,4],[1,3],[1,4],[2,4]]...]
Are there any libraries which contain functions that do this directly?