The Underscore library is great for all those kinds of tricks; I love it and wouldn't be able to live without it!!
Once you declare it, you call its functions by using the underscore, like this:
_.uniq([1, 4, 7, 1, 2, 1, 3, 1, 4]);
=> [1, 4, 7, 2, 3]
If you want it sorted:
_.uniq([1, 4, 7, 1, 2, 1, 3, 1, 4]).sort();
=> [1, 2, 3, 4, 7]
From the page linked above:
"Underscore provides 60-odd functions that support both the usual functional suspects: map, select, invoke — as well as more specialized helpers: function binding, javascript templating, deep equality testing, and so on."