# Problem with counting card challenge?

here is my code, i have not understand what was did i wrong here!
with explanation.

``````var count = 0;
function cc(card) {
// Only change code below this line

switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
count += 1;
break;
case 7:
case 8:
case 9:
count += 0;
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
count -= 1;
break;
}

return count + (count > 0 ? "Bet" : "Hold");
// Only change code above this line
}

cc(2); cc(3); cc(7); cc('K'); 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 (â€™).

1 Like

Hi @hsurwase !

You have a spacing issue.

Add this ` console.log(count + (count > 0 ? "Bet" : "Hold"))` right above the return statement and you will see what I mean.

1 Like

Hi @jwilkins.oboe
I understand, I need to put a space between the count and bet.
Iâ€™m trying to space between them but fail

Did you also add a space between count and hold?

No,

``````console.log((count + (count > 0 ? " Bet " : " Hold ")))
```Preformatted text``````

You donâ€™t need to add a space at the end of Bet or Hold.

You just need to add a space before the words.

Also, make sure you are adding those space to the return statement too.

1 Like

Yes, it workedâ€¦
thanks youâ€¦

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.