Stuck on: Comparisons with the Logical And Operator

This seems really simple
https://www.freecodecamp.com/challenges/comparisons-with-the-logical-and-operator

I am supposed to:
Combine the two if statements into one statement which will return “Yes” if val is less than or equal to 50 and greater than or equal to 25. Otherwise, will return “No”.

I’ve written what appears to be something perfect but FreeCodeCamp rejects it. Here’s my code:
https://repl.it/CeFK/2 It works fine but here’s a screencap of the errors:

1 Like

Hi :slight_smile:

“Yes” !== “yes”

2 Likes

If “yes doesn’t equal yes” ?

Sorry, don’t understand :frowning:

@texxs, I think @Diego_Perez is trying to say is that you have spelled out “yes” with lowercase in your return statement, where the instructions are telling you to use “Yes”, with uppercase “Y”

Try making that change.

sorry @texxs i should have been more clear . Jlevyd15 is right i was trying to say:[quote=“Jlevyd15, post:4, topic:21652”]
you have spelled out “yes” with lowercase in your return statement, where the instructions are telling you to use “Yes”, with uppercase “Y”
[/quote]

function test() {
if (“Yes” !== “yes”) {
return “Not equals”;
} else {
return “equals”;
}
}

test();

The output is = “Not equals”;

function test() {
if (“Yes” === “yes”) {
return “equals”;
} else {
return “Not equals”;
}
}

test();

The output is = “Not equals”;

Doh!

Thanks guys!
Sometimes I get so focused on the big picture I can’t see the little stuff. sometimes I just need to look character by character I guess.

The most frustrating and time consuming bugs are usually the simple typos, in my experience. It’s easy to get tunnel vision.