sylvainpv 837 days ago. link 1 point ▲ ▼solution with reduce: function compareTriplets(a,b) { return a.reduce(([scoreA, scoreB], _, i) => [scoreA + (a[i] > b[i]), scoreB + (b[i] > a[i])], [0,0]) }