Here is my solution. I hope it would help someone
const countOccurence = (string, char) => {const chars = string.match(new RegExp(char, 'g')).lengthreturn chars;}
Here is my solution. I hope it would help someone
const countOccurence = (string, char) => {const chars = string.match(new RegExp(char, 'g')).lengthreturn chars;}