I am learning JavaScript. I was playing around and wrote a function to find the largest integer. It works just fine, but I was wondering how I can DRY it up.
function largerInt(int1, int2, int3, int4) {
if (int1 > (int2 && int3 && int4)) {
console.log(int1);
} else if (int2 > (int1 && int3 && int4)) {
console.log(int2);
} else if (int3 >(int1 && int2 && int4)) {
console.log(int3);
} else if (int4 >(int1 && int2 && int3)) {
console.log(int4);
}
}