Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

counting duplicates codewars javascript

function duplicationCount(text){
  return text.toLowerCase().split('').filter((val, i, arr) => {
    return arr.indexOf(val) !== i && arr.lastIndexOf(val) === i;
  }).length;
}
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #counting #duplicates #codewars #javascript
ADD COMMENT
Topic
Name
2+3 =