Tell us what’s happening:
Describe your issue in detail here.
The code refuses to accept anything except if (count <= 0){then return etc}
Also I am pretty sure it would not accept the video solution as I have not been able to get that one to show anything decent on screen.
I have solved it but it is awkward finding correct responses fail. I only was rejected on the 10,“J”,“Q”,“K”,“A” = -5 despite having count – or count -= 1 for the above reason which makes it hard to believe more of the teaching
**Your code so far**
let count = 0;
function cc(card) {
// Only change code below this line
let answer;
switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
count++;
break;
case 7:
case 8:
case 9:
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count = count-1;
break;
}
if (count <=0 ){
return count + " Hold" ;
}else{
return count + " Bet";
}
/*After you’ve counted the cards, use an if statement to check the value of count. Also, make sure your return has a space between the number and the string.*/
// Only change code above this line
}
cc(2); cc(3); cc(7); cc('K'); cc('A');
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36 Edg/104.0.1293.54
Challenge: Basic JavaScript - Counting Cards
Link to the challenge: