Tell us what’s happening:
Describe your issue in detail here.
I’ve been attempting the card counter excercise and used switch statements for the code and it’s counting the negative and 0 count value cards right but not the positive?
**Your code so far**
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++;
break;
case 7:
case 8:
case 9:
count+= 0;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count--;
break;
}
var holdOrBet = 'Hold'
if (count > 0){
return holdOrBet = 'Bet'
}
return count + ' ' + holdOrBet;
// Only change code above this line
}
// running tests Cards Sequence 2, 3, 4, 5, 6 should return
5 Bet
Cards Sequence 2, J, 9, 2, 7 should return the string
1 Bet
Cards Sequence 2, 2, 10 should return the string
1 Bet
// tests completed
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36
Challenge: Counting Cards
Link to the challenge: