Stuck at Counting Cards Challenge

**Tell us what’s happening:**H
Hello , this is my code so far and i checked many times in the forum with other people’s code and i can’t figure out where my mistake is. Would be really happy if someone helped.

Your code so far


var count = 0;

function cc(card) {
switch (card) {
 case 1:
 case 2:
 case 3:
 case 4:
 case 5:
 case 6:
 count++;
 break;
case 10:
case J:
case K:
case Q:
case A:
count--;
break;
case 7:
case 8:
case 9:
count;
}
if (count > 0) {
return count + "Bet";
} else  {
return count + "Hold";
}}
cc(2); cc(3); cc(7); cc('K'); cc('A');

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; rv:74.0) Gecko/20100101 Firefox/74.0.

Challenge: Counting Cards

Link to the challenge:

@malakguelil hey,

your code solution works fine there’s just a couple of problems that will make it fail tho, your letter cases need to be strings like “J”, also you need a space in your return strings too like " Bet"

1 Like

It worked after i did as you told , Thankyou .

2 Likes