let a = [12, 20, 11, 22];
let b = [20, 30, 12, 23];
let scores = a.reduce((result, currentValue, index) => {
if (currentValue > b[index]) {
result[0]++;
} else if (b[index] > currentValue) {
result[1]++;
}
return result;
}, [0, 0]);
console.log("Bob's Score:", scores[0]);
console.log("Alice's Score:", scores[1]);
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)