Remove duplicates in array
This function sorts an array and returns the unique items



Remove duplicates from the array using Array#filter
Sort the array using Array#sort


Code:

function uniques(arr) {
    // Remove the duplicate elements from the array
    return arr.filter(function (element, index, arr) {
        return arr.indexOf(element) === index;
    }).sort(function (a, b) {
        return a - b;
    });
}