I have to make a function in JavaScript that removes all duplicated letters in a string. So far I\'ve been able to do this: If I have the word \"anaconda\" it shows me as a
function removeDuplicates(string){ return string.split('').filter((item, pos, self)=> self.indexOf(item) == pos).join(''); }
the filter will remove all characters has seen before using the index of item and position of the current element