This commit is contained in:
Philippe Torrel
2026-11-03 11:40:59 +01:00
parent a885cd9550
commit baf557f666
17 changed files with 1158 additions and 19 deletions
@@ -1,12 +1,14 @@
// logical error
function findMaximum(a, b, c) {
if (a > b && a > c) {
return a;
} else if (b > a && b > c) {
return b;
} else {
return c;
}
// if (a >= b && a >= c) {
// return a;
// } else if (b >= a && b >= c) {
// return b;
// } else {
// return c;
// }
return Math.max(a, b, c);
}
console.log(findMaximum(1, 2, 3)); // => 3