let phrase = prompt('Enter the phrase')
function letter(phrase) {
let frequency = {}
for(letter of phrase){
if(letter in frequency){
frequency[letter]++
}
else{
frequency[letter]=1
}
}
return frequency
}
console.log(letter(phrase))
I want to have the result without the whitespaces. I have tried the split method but it then returns the count of the words not the letters.