Getting all possible combination of vector with all possible order

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.

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]
2 Likes

That’s what I needed, thanks!