Basic JavaScript: Comparisons with the Logical And Operator -- is there a bug?

Tell us what’s happening:
This is what I need to do : “Replace the two if statements with one statement, using the && operator, which will return “Yes” if val is less than or equal to 50 and greater than or equal to 25. Otherwise, will return “No”.”

Can someone check my code? Is there a bug to this or I got it wrong??

Your code so far


function testLogicalAnd(val) {
// Only change code below this line


 if (val >= 50 && val <= 25){
    return "Yes";
  }
// Only change code above this line
return "No";
}

testLogicalAnd(10);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36.

Challenge: Comparisons with the Logical And Operator

Link to the challenge:

No there is no bug
Take a good look at your code

>= 50 && val <= 25

If this code

num > 5 && num < 10

will outputs this :6 7 8 9
because it starts from bigger than 5 through until the number smaller than 10.
But if we flip it around

10 && num <5

will it happen the same?

your if condition is always false since there is no number which is >=50 and <=25.

so you have to change the condition as
val <=50 && val >=25