[Solved] Array’s elements in JavaScript [duplicate]
This is an approach using Array.reduce() https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce First I determine for each unique value in the array how many times it does occur, by returning an object like {“1”: 3, “2”: 3, “3”: 1} Then I determine which are the values occurred most of the times in the array, by returning an object like {“count”: … Read more