Ребята, фигня получается, помогите пожалуйста
function getResult(scoreA, scoreB){
return scoreA > scoreB ? 1 : scoreA < scoreB ? -1 : 0
}
const stoneGameVI = function (aliceValues, bobValues) {
return getResult(winAlice, winBob)
}
const arr = function(aliceValues) {
return aliceValues.map( (e, i) => [e + bobValues[1], e, bobValues[1] ])
}
const subtract = (a, b) => b[0] - a[0];
const getAmount = (e, i) => [e + aliceValues[1], e, aliceValues[1] ];
const sumAmount = (currentTotalAmount, order) => currentTotalAmount + order[1];
const winAlice = function(aliceValues) {
return aliceValues
.filter(subtract)
.map(getAmount)
.reduce(sumAmount, 0);
}
const sumbob = (currentTotalAmount, order) => currentTotalAmount + order[2];
const bobValues = function(bobValues) {
return bobValues
.reduce(sumbob, 0);
};