# Counting Cards >> What's wrong with my code? I can't see any error here but it's being stuck each time i submit. Please check my code and notice the error

Counting Cards >> What's wrong with my code? I can't see any error here but it's being stuck each time i submit. Please check my code and notice the error
0

#1

Tell us what’s happening:

``````
function cc(card) {
// Only change code below this line
switch(card) {
case 2:
case 3:
case 4:
case 5:
case 6:
count++;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count--;
break;
}

if (count > 0) {
return count + "Bet";
}
else{
return count + "Hold";
}
}

``````

Your Browser User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36`.

#2

Your error is one that I made doing it as well. It doesn’t actually say what to return if the count actually is at 0.

``````  if (count => 0) {
return count + " Bet";
} else
return count + "Hold";``````

#3

Make sure you still have the following line of code above your function:

``````var count = 0;
``````

This will not completely solve your problem, because you need to look at your two return statements. The tests are expecting a space between the count and the word (Bet or Hold).

#4

ohhhooo !
I have wasted almost 1 hour for this
Thank you @rmdawson71

#5

Actually error was here - The tests are expecting a space between the count and the word (Bet or Hold).
Thank you.

#6

Below is a part of the instructions which deals with how to handle a zero count.

`The function will then return a string with the current count and the string "Bet" if the count is positive, or "Hold" if the count is zero or negative.`

#7

I was referring to the code posted in the original post. I went the opposite route in solving it, and my code will not pass without the “=” in the if statement.

`if (count <= 0) { return count + " Hold"; } else return count + " Bet";`. .