<script> var next = [170,170,170,170,170,890,130,130,130,260].sort().reduce((arr, curr, idx, initArr) => { !(curr in arr) ? arr[curr] = 1 : arr[curr]++ return arr; }, {}) console.log(next) </script>