Javascript – How to count string occurrences in an array of strings in TypeScript?
I need to iterate over an array of strings, count the occurrences of each string, and return a object with the value and the number of occurrences. I'm trying to use the array reduce function to achieve such thing, but,…