1 const numOfAppearances = (array, value) => {
2 return array.reduce((acc, currVal) => currVal === value ? ++acc : acc, 0);
3 };
4
5 const count = numOfAppearances(['one', 'yes', 3, 'yes', false], 'yes'); // 2
1 array = [1, 1, 2, 2, 2, 3]
2 max(set(array), key=array.count) # 2