Stuck on: Comparisons with the Logical And Operator

Stuck on: Comparisons with the Logical And Operator
0

#1

This seems really simple

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:


#2

Hi :slight_smile:

“Yes” !== “yes”


#3

If “yes doesn’t equal yes” ?

Sorry, don’t understand :frowning:


#4

@texxs, I think @erretres 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.


#5

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”;


#6

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.


#8

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