RosettaCodeData/Task/Remove-duplicate-elements/CoffeeScript/remove-duplicate-elements.coffee

7 lines
146 B
CoffeeScript
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
data = [ 1, 2, 3, "a", "b", "c", 2, 3, 4, "b", "c", "d" ]
set = []
set.push i for i in data when not (i in set)
console.log data
console.log set