Basically I need to transform a ternary operator into a conditional operator using "if...else" cycle.
function getBestStudent (students) {
const bestAverageMark = students.reduce((a, b) => getAverageMark(a) > getAverageMark(b) ? a : b)
return bestAverageMark
}
"getAverageMark" here is another function.
How can I transform this into a conditional operator "if... else"? Thank you!