UNPKG

@krebitdao/reputation-passport

Version:

Krebit SDK for Verified Credentials

8 lines (7 loc) 218 B
export const mergeArray = (arr) => { const counts = {}; for (const num of arr) { counts[num] = counts[num] ? counts[num] + 1 : 1; } return Object.entries(counts).sort((a, b) => b[1] - a[1]); };