Return Entire thread

I need to make a function.

1 Name: Anonymous 2018-11-24 23:28
I need to make a function that creates permutations recursively. Here we get [[1, 1, 1], [1, 1, 2], [1, 2, 1], [1, 2, 2], [2, 1, 1], [2, 1, 2], [2, 2, 1], [2, 2, 2]] as all possible permutations of length 3, but I need to generalize it to length n.
Anyone up for a challenge?

Return Entire thread
Name:
Leave this field blank: