Removing array duplicates in Javascript

javascript, es5

A quick way to remove duplicates in JS in ES5. It needs an array.filter polyfill for IE < 9

As long as the order doesn't matter

//A quick way to remove duplicates in JS. It needs an array.filter polyfill for IE < 9
var arrayToFilter = [ 4, 5, 5, 5, 2, 1, 3, 1, 1, 2, 1, 3 ];
arrayToFilter.
  sort().
  filter(function (element, i, arr) {
    return (i === 0) || (element !== arr[i-1]);
  });