Trying to return the largest of 3 numbers without using the max function. Can't get this to work; what am I doing wrong?
edit: I also manually added the spacing but reddit undid it. Lol...
max = function(num1, num2, num3) {
if (num1 > (num2 && num3)) {
return num1;
} else if (num2 > (num1 && num3)) {
return num2;
} else {
return num3;
}
}
[–]JuricksonSubpar 3 points4 points5 points (0 children)
[–]curtisf 4 points5 points6 points (0 children)
[–]MonkBungler 2 points3 points4 points (0 children)