Answers for "javascript remove duplicate letters in a string"

1

javascript remove duplicate letters in a string

function removeDuplicateCharacters(string) {
  return string
    .split('')
    .filter(function(item, pos, self) {
      return self.indexOf(item) == pos;
    })
    .join('');
}
console.log(removeDuplicateCharacters('baraban'));
Posted by: Guest on February-29-2020

Code answers related to "javascript remove duplicate letters in a string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language