Start coding by opening index.html
.
Write a function that counts the number of times each letter occurs in a given string. It should return an object containing the count for each letter.
For example, given the word "apple", letterCount("apple")
should return:
{
"a": 1,
"p": 2,
"l": 1,
"e": 1
}
Bonus: Make sure that lower case letters and upper case letters count for the same character. Also, ignore spaces and punctuation.
Super Bonus: Utilize filter
, map
and reduce
in your solution.
Beyond: Try out this CodeWars challenge.