This is for es2015 and above as far as I know. There are 'cleaner' options with ES6 but this a great way to do it (with TypeScript).
let values: any[] = [];
const distinct = (value: any, index: any, self: any) => {
return self.indexOf(value) === index;
};
values = values.filter(distinct);