afonsoalban
8/29/2017 - 5:16 PM

Remove duplicates

Returns an array with no duplicates items.

function removeDuplicates (array) {
  return array.filter(function(elem, index, self) {
    return index == self.indexOf(elem);
  });
}