lesson-cover

Go Back

Variables & Functions

Letter Count

Write a function called solution that takes in 2 parameters, a string and a letter, and returns the number of times the character shows up in the string

result = solution('abc', 'a') // 1
result = solution('bccbccb', 'b') // 3

Reminder for students with prior experience: you are not allowed to use for and while loops. Reason