JSFiddle - React, Tailwind, and code Playground
by saidulu401
JavaScript
function findRepeatedChars(word){
const repeated = {};
const final = {};
console.log(word,'word..')
for(let i=0;i<word.split('').length;i++){
console.log(word[i],'word')
if(!repeated[word[i]])
{
repeated[word[i]] = 1;
}else{
repeated[word[i]]++;
}
}
return repeated;
}
console.log(findRepeatedChars('poplling'))
//constm hook