Number of occurrence
Return the number of occurrence of a certain letter in the given string.
Sample Code:
function countLetters(str,letter) {
// Enter your logic here...
}
Examples:
Input: 'Javascript','a'
Output: 2
Explanation: 2 a's to be found.
Input: 'I put the pro in procrastinate',' '
Output: 5
Explanation: 5 spaces to be found.