Вариант с lodash:
const arr = [1,1,1,1,1, 3,3,3,3,3, 5,5 ,6,6,6, 7,7,7,7,7]
const items = _.countBy(arr) // {1: 5, 3: 5, 5: 2, 6: 3, 7: 5}
const max = _.max(_.toArray(items)) // 5
const result = []
_.forIn(items, (value, key) => {
if (value === max) result.push(key)
})