<script>
const stringcharcount = (str)=>{
alert();
let obj = {};
for(let char of str)
(!obj[char]) ?obj[char]=1:obj[char]++;
console.log(obj);
}
stringcharcount("vishalvuisete333");
</script>
output:
{ '3': 3, v: 2, i: 2, s: 2, h: 1, a: 1, l: 1, u: 1, e: 2, t: 1 }
Thanks you for commenting your questions. I will see question and respond you.