function duplicateCount(text){
var lower = text.toLowerCase();
var count = 0;
var used = [];
lower.split('').forEach(
function(letter) {if (!used.includes(letter) && (lower.split(letter).length - 1) > 1) {count++; used.push(letter);}});
//
console.log(used);
console.log(count);
return count;
}
// 1 1 1 1 1
duplicateCount("Hollla soy una prueba");
// Sample forEach()
// before
for (let i = 0; i < items.length; i++) {
copyItems.push(items[i]);
}
// after
items.forEach((item) => {
copyItems.push(item);
});
To embed this project on your website, copy the following code and paste it into your website's HTML: