Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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'));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #remove #duplicate #letters #string
ADD COMMENT
Topic
Name
1+2 =