I'm trying to get this function done but something is wrong, it should return 50 for a=5,b=10 or 2 for a=1,b=1. However any other way to write this function would be interesting
function getLargestExpressionResult(a, b) {
const sum = a + b;
const prod = a * b;
const diff = a - b;
const quot = a \ b;
let res = sum;
if (prod > res) res = prod;
if (diff > res) res = diff;
if (quot > res) res = quot;
return res;
}
enter code here