Getting all possible combination of vector with all possible order

question

#1

I know that there is combination function whthin package 'Combinatorics’
which gives me all possible combination without regarding order of elements

x = combinations([1,2,3], 3)

# which gives this
collect(x) => [1,2,3]

# but I couldn't find function for getting this. 
=> [[1,2,3], [2,1,3], [3,1,2], [3,2,1]]

I looked up “Combinatorics” and “Iterators” Packages, but couldn’t find function I need.

thanks for your time.


#2

Perhaps:

julia> x = permutations([1,2,3]) |> collect
6-element Array{Array{Int64,1},1}:
 [1,2,3]
 [1,3,2]
 [2,1,3]
 [2,3,1]
 [3,1,2]
 [3,2,1]

#4

That’s what I needed, thanks!