a > c || b > c > a) { conso" /> a > c || b > c > a) { conso" /> a > c || b > c > a) { conso"/>

Basic JavaScript Query

20 views Asked by At
let a = 10;
let b = 500;
let c = 50;

if (a > b > c || a > c > b) {
  console.log("a is the largest number.");
} else if (b > a > c || b > c > a) {
  console.log("b is the largest number.");
} else {
  console.log("c is the largest number");
}

I want to know why the console shows me that c is the largest number.

The else if condition holds true for both cases, so why is it not executed.

0

There are 0 answers