Question: Write a JavaScript function that accepts two parameters/arguments, a string and a letter (string) and the function will count the number of occurrences of
Write a JavaScript function that accepts two parameters/arguments, a string and a letter (string) and the function will count the number of occurrences of the specified letter within the string and return that value. Example: the first argument is "hello" and the second parameter is "I". The function should return 2 because there are two is in "hello". Must use a function. The first parameter will be at least one character in length. The second parameter will be exactly one character in length and will always be a letter. The function should not care about case... "h" and "H" should both be counted as the same.
Step by Step Solution
There are 3 Steps involved in it
The question is asking for a JavaScript function that takes two parameters a string and a singlelett... View full answer
Get step-by-step solutions from verified subject matter experts
