Easy
JavaScript Array Map and Reduce: Calculating Total Score with Conditional Bonus Multiplier
What will be the output of the following code, and why?
1let scores = [10, 20, 30];2let bonus = 5;34let total = scores.map(score => score + bonus).reduce((sum, score) => {5 if (score > 25) {6 sum += score * 2;7 } else {8 sum += score;9 }10 return sum;11}, 0);1213console.log(total);