# Counting cards help on first IF statement

Hello, I’d like to know why my code works the first way but doesn’t work the second way. Any help appreciated:

``````// Working
var count = 0;
var verb = 0
function cc(card) {
// Only change code below this line
if(card==2 || card==3 || card==4 || card==5 || card==6){(count++)}
else if(card>6 && card<10){}
else if(card == 10, 'J','Q','K','A'){count--}
else{lol}

if(count >0){verb = "Bet"}
else if (count == 0){verb = "Hold"}
else ("hold")

return count +" "+verb;
// Only change code above this line
}

cc(3); cc(3); cc(7); cc('K'); cc('A');

console.log(cc(10));
console.log(cc("J"));
console.log(cc("Q"));
console.log(cc("K"));
console.log(cc("A"));
``````
``````//Not working:
var count = 0;
var verb = 0
function cc(card) {
// Only change code below this line
if(card == 2, 3, 4, 5, 6){(count++)}
else if(card>6 && card<10){}
else if(card == 10, 'J','Q','K','A'){count--}
else{lol}

if(count >0){verb = "Bet"}
else if (count == 0){verb = "Hold"}
else ("hold")

return count +" "+verb;
// Only change code above this line
}

cc(3); cc(3); cc(7); cc('K'); cc('A');

console.log(cc(10));
console.log(cc("J"));
console.log(cc("Q"));
console.log(cc("K"));
console.log(cc("A"));
``````

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

This line does not have a valid multiple comparison.

But, it still passes the challenge so I don’t get it.

It “accidentally” passes.

This line works correctly, and

this line works correctly, but

this line is effectively an ‘else’ clause because the test is always true. You get identical results if you replace that line with

You got the multiple comparison correct in this place:

You have to use separate comparisons separated by `||` or `&&`. You can’t use a single comparison with values separated by commas.

I hope this helps clarify.

This perfectly clarifies. Big thanks.

Have a good day.
Bastian.