Question: Declare a function 'charCount', which takes in a single character as an argument and returns another function. The returned function takes a string as an
Declare a function 'charCount', which takes in a single character as an argument and returns another function. The returned function takes a string as an argument, and when invoked, it will search that string for the character initially passed in to the 'charCount' function, and return the number of occurrences.
Once complete, right some code to test your 'charCount' function.
Javascript ES6 Please. Thank you.
Step by Step Solution
There are 3 Steps involved in it
javascript const charCount char return str let count 0 for let i 0 i ... View full answer
Get step-by-step solutions from verified subject matter experts
