Всім салют.
Як можна зарефакторити щоб замінити тернарник в reduce?
thx
function countPoints(gameResults) {
gameResults.reduce((totalPoints, current) =>
totalPoints + (current[0] > current[2] ? 3 : current[0] === current[2] ? 1 : 0), 0);
}
countPoints(['3:1', '1:0', '0:0', '2:3']);