The description of jQuery.unique() states:
Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays
If not limited using jQuery, consider to use Set from ES6.
var arr = ['foo', 'bar', 'bar']; Array.from(new Set(arr)); // #=> ["foo", "bar"]
Working for Firefox 45, Safari 9 and Chrome 49.