countOccurrences([1, 2, 2, 3, 3, 3], 3) // β 3countOccurrences counts how many times a given value appears in an array.
Challenge: Implement countOccurrences<T>(arr: T[], value: T): number counting how many times value appears.
countOccurrences([1,2,3,2,1,2], 2) // β 3