# Getting stuck with: Comparisons with the Logical And Operator

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"` .

What I understood:
Then first we need to set 50 less our equal to which we did with the the <=
Then we use the && to combine them into one like the example
then it ask to set it equal to 25 which is the ==

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

if (val < = 50 && val == 25) {
return "Yes";
}
``````

Your code will only return “Yes” if `val` is exactly 25. Your conditional says “If `val` is less than or equal to 50 AND `val` is 25, return ‘Yes’”.

1 Like

I see what you mean :3 ty AL
I did need to put the 25 first since they asked equal to 25 and greater then 50.
The sollution then becomes:

``````  if (val>= 25 && val<= 50) {
``````

There you go.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8418213,"math_prob":0.99566483,"size":660,"snap":"2020-34-2020-40","text_gpt3_token_len":167,"char_repetition_ratio":0.111280486,"word_repetition_ratio":0.0,"special_character_ratio":0.26666668,"punctuation_ratio":0.07874016,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98973674,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-09-23T14:04:31Z\",\"WARC-Record-ID\":\"<urn:uuid:26549fea-c352-4b7c-8ce1-577326564532>\",\"Content-Length\":\"29494\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e8414540-075c-4aaa-a630-3bb3595b6bec>\",\"WARC-Concurrent-To\":\"<urn:uuid:5f06ed7b-cd1c-4b10-aaa6-c906c634912d>\",\"WARC-IP-Address\":\"64.71.168.201\",\"WARC-Target-URI\":\"https://forum.freecodecamp.org/t/getting-stuck-with-comparisons-with-the-logical-and-operator/317527\",\"WARC-Payload-Digest\":\"sha1:KWW5PDYXIND3JX7RWGBDMNSYH77VZM6H\",\"WARC-Block-Digest\":\"sha1:PAMIXHWCPE7PFOA464YS7QSQ2UIZUVIF\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-40/CC-MAIN-2020-40_segments_1600400210996.32_warc_CC-MAIN-20200923113029-20200923143029-00226.warc.gz\"}"}