Pick the result with the most occurrences (consensus).
counts[r]
sort
function getConsensus(results) { const counts = {}; results.forEach(r => counts[r] = (counts[r] || 0) + 1); return Object.entries(counts).sort((a,b) => b[1] - a[1])[0][0]; }