Remove duplicate elements

var ary = [1,1,2,1,'redundant',[1,2,3],[1,2,3],'redundant']
say ary.uniq
say ary.last_uniq

Output:

[1, 2, 'redundant', [1, 2, 3]]
[2, 1, [1, 2, 3], 'redundant']

Last updated